Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get webpage html from Chrome window and check for html
#1
Hi, I was wondering if you could help me out. I've been trying to get some html text from a webpage in Chrome to create an alert everytime specific users are listed as being online, however the way the page is formatted the username and online text are separate elements and therefore I can't use the find accessible object action.

I have tried using the html options with IE but the time taken to check for multiple users was too long that they can be gone before the check is complete.

The html i'd like to check is formatted as follows:

Code:
Copy      Help
<i style="float: right; ">user 1 last on: <b>online now</b></i>
<i style="float: right; ">user 2 last on: <b>online now</b></i>
<i style="float: right; ">user 3 last on: <b>online now</b></i>
<i style="float: right; ">user 4 last on: <b>online now</b></i>
<i style="float: right; ">user 5 last on: <b>online now</b></i>
<i style="float: right; ">user 6 last on: <b>online now</b></i>
<i style="float: right; ">user 7 last on: <b>online now</b></i>

Ideally I need a way of copying the entire html of the browser window to a variable to then check for the above text and display something like "user 1 online" in the output.

Is there a way of doing this?

I have tried using IntGetFile to get the html but the page I am accessing requires I am logged in, therefore I cant access this page in this manner.

Best regards,

Paul
#2
Can get HTML only from IE and Firefox.

You can use accessible objects. Find the common parent, get all its children...

Macro Macro167
Code:
Copy      Help
out

int w=win("Chrome" "Chrome_WidgetWin_1")
Acc a.Find(w "STATICTEXT" "online now" "" 0x3001 3 0 "parent2") ;;find common parent; at first "online now" object, then its parent's parent
ARRAY(Acc) b; int i
a.GetChildObjects(b 1 "STATICTEXT") ;;get all level 1 descendants that have role "STATICTEXT"
for i 0 b.len 2 ;;0, 2, 4, ...
,str user=b[i].Name
,if(user.end(" last on: ")) user.remove(user.len-10)
,out F"{user} online"


Forum Jump:


Users browsing this thread: 1 Guest(s)