Grab text from a web search

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
PepsiHog
Automation Wizard
Posts: 517
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Grab text from a web search

Post by PepsiHog » Fri Mar 25, 2016 2:39 pm

I have been for hours trying to get text from an instance of IE. The page contains search results. I want to get the url below a link. I have been trying all of the gettext commands without any success.

The one I have been mainly trying to get results from is GetWindowTextEx.

Here is the scribble I have been playing with.

Code: Select all

let>WinName=Star Trek (2009) - IMDb

IECreate>IE[0]

//IENavigate>IE[0],https://www.google.com/?gws_rd=ssl,res
IENavigate>IE[0],Star Trek (2009) - IMDb,res
IEWait>IE[0]
GetWindowHandle>%WinName%*,WinHan
let>win_usehandle=1
SetFocus>WinHan
wait>10
//GetWindowText>WinHan,AllText
GetWindowPos>Winhan,x,y
GetWindowSize>Winhan,w,h
//let>y=%y%+10
GetTextInit
//GetTextAtPoint>x,y,text,nChar
//mdl>%text%

GetWindowTextEx>WinHan,res
mdl>%res%


//mdl>%intLeft%

//GetTextAtPoint>
//mdl>%AllText%  %x%,%y%


//IEGetURL>IE[0],IsUrl
//IEGetTags>IsUrl,,,Test
//GetWindowList>wl
//mdl>%wl%



//Click A tag with text "Log In" in IE[0] instance
//IEClickTag>IE[0],,,A,TEXT,Log In,result
I'm in the testing phase, so the script is not well formatted. As you can see I have been trying quite a bit.

Appreciate any help.

Thanks,
PepsiHog

I am working my way to IMDb. Since the search has IMDb in it, the result should be the first link. In my tests, they have been. I now want the url that is below the link. It will be a link for IMDb. That is my goal to grab.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Grab text from a web search

Post by Marcus Tettmar » Tue Mar 29, 2016 8:23 am

Don't think those commands are ever going to see text in IE. You want to be using IEGetTags/IEGetTagsByAttrib. If you were to post the HTML and tell us what you want to extract we'd be able to help further.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
PepsiHog
Automation Wizard
Posts: 517
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: Grab text from a web search

Post by PepsiHog » Sat Apr 02, 2016 1:51 pm

Thanks Marcus. I have already been given assistance from Dorian. The resulting macro works awesomely. And I learned how to easily get information from the internet.

PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts