Jump to content

Assign variables from a string from a web page


Recommended Posts

Any pointer on how to get these variables from a string?

Im doing a search on a web based search engine. I get about 150 results per page. The LAN id is something I use to extract the information needed. The problem though is i need to do a search by Job Title then I search for the lan id on the web page and I need the following variables created. ( It's a messed up system I know.... )

The hardest thing i think is to get the groupid for the person.... because of its location etc and being random.

$groupid <--- fact always above the groupings of people in a district and always starts with GROUP

$telephone <--- fact always starts with " tel/ " odd... i thought so too

$fname <--- always the second box

$lname <---- always the third box

$lanid I will always have this information and search by it on each page, depending on the lan id the person im looking for may be on a different section of the web page.

I have attached a sample page in html format and here's my code so far. Again if you can push me in the right direction on which functions to use next to pull the needed data. I have looked at all these functions.

StringCompare, StringLeft, StringLen, StringLower, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringUpper, StringRegExp, StringSplit

they dont quite seem to do the trick. in the example im doing a search for mary jane. LAN ID j1092834 Thanks!

ToolTip("starting ..... ", 0, 0)
Send("#r")
Send("{DEL}") ;delete any past commands
Send("C:\Users\Administrator\Desktop\test.html") ;normally this would be a website link..
Send("{ENTER}")
Sleep(3000) ; sleep so i know where the program has progressed to
Send("{^a")
Send("{^c")
Do
;Local $textFromPage = WinGetText("Results.Autopulled", "")  ; this didnt work for some reason
ToolTip("verifying page was loaded fully ", 0, 0)
Sleep(200)
Until StringInStr(ClipGet(), "Success")
Sleep(3000) ; sleep so i know where the program has progressed to
ToolTip("scanning for j1092834 now ", 0, 0)
$clipData = ClipGet()
If StringInStr($clipData, "j1092834") Then
ToolTip("searching for string j1092834", 0, 0)
Sleep(3000)
Else
ToolTip("sorry failed to locate id", 0, 0)
Sleep(30000)
EndIf
ToolTip("writing data to text file", 0, 0)
Sleep(3000)
; Local $fileData = StringLeft("j1092834", 50)  this didnt work, it didnt grab anything other then the LAN id
FileWrite("results.txt", $fileData)

test.html

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...