Sign in to follow this  
Followers 0
Overlord

reading from form

2 posts in this topic

#1 ·  Posted (edited)

I don't know what marks my object here?

I'm trying to get names from a form and process them one by one further in the script.

I tried getting the proper list before with some other solutions but can't get it really 100% to work. It's probably going to be some stupid error..

this was the first try:

$oIE = _IECreate($sURL1)
$sHTML = _IEBodyReadText($oIE)
$output = StringSplit($sHTML, "join. ", 1)
$uninvitedlist = StringLeft($output[2], StringInStr($output[2], "You haven't selected") - 1)
$arrayOfNames = StringRegExp($uninvitedlist, "([A-Z][a-z]+ [A-Z][a-z]+(?: [A-Z][a-z]+)?(?: [A-Z][a-z]+)?)", 3)
For $name In $arrayOfNames
MsgBox(0, "", $name)
$oIE.Navigate2($friendslist, $navOpenInNewTab)
ConsoleWrite($friendslist)

this worked but only partly. names like McAlister were not checked neither as names which contain symbols. Thx a lot to Skizmata for this attempt.

Later I came up with this:

#include <IE.au3>
#include <Array.au3>
Global $sURL1 = "http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=recruit&xw_action=view"
$oIE = _IECreate($sURL1); opens the MY mafia page
$sHTML = _IEBodyReadHTML($oIE);  reads all the text on MY MAFIA
$output = StringSplit($sHTML, "fb_protected=", 1); split after 
$output2 = StringTrimLeft($output[2], 13)
$uninvited = StringLeft($output2, StringInStr($output2, "</SPAN></LABEL><LABEL class") - 1); split before 
ConsoleWrite($uninvited & @LF); write output to console. this should be only the names

This solution gives me teh name. However it only gives me teh first name.

I actually want to filter behind : fb_protected="true" /><span> but can't put it in $output because of the "true"

$output = StringSplit($sHTML, 'fb_protected='&'"true"' & ' /><span>', 1); split after

didn't work

after some testing it seems my problem is caused by /

now I tried this:

#include <IE.au3>
Global $sURL1 = "http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=recruit&xw_action=view"
Global $oLink
$oIE = _IECreate($sURL1); opens the MY mafia page
$oForm = _IEFormGetCollection ($oIE, 1); read from the second form on the page
$oQuery = _IEFormElementGetCollection ($oForm, 1)
consolewrite(_IEFormElementGetValue ($oQuery) & @LF)

and this marks what I need. For now I'm getting the number while I need the name :-(

This comes from the source from the page I'm trying to read.

<label class="clearfix"><input type="checkbox" class="inputcheckbox" id="ids[]" name="ids[]" value="1499403841" fb_protected="true" /><span>Brian Posey</span></label>

Can anyone point me in the right direction here and please help me? As you can see I have tried.

Either I go for the second script or the third. What would be best and how can I get all the names in a for next loop displayed? The main problem is that you never know before how big the list is until you see it.

Edited by Overlord

Share this post


Link to post
Share on other sites



*bump*

anyone who can help me plz?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0