Find text on a web page

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Trevor Hughes
Junior Coder
Posts: 25
Joined: Sun Dec 15, 2013 9:27 pm

Find text on a web page

Post by Trevor Hughes » Thu Aug 31, 2017 11:31 pm

Hello

I was wondering if it was possible to find text on a web page where the text was on a part of the page that was not on screen.

I am filling out various fields on a web page that requires me to scroll, so some fields are not on screen.

If there is a way to do this I would appreciate any guidance.

Kind regards
Trevor

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Find text on a web page

Post by JRL » Sun Sep 03, 2017 5:18 am

Pressing ctrl + a seems to highlight all the text at least on some web pages. Pressing ctrl + c would then copy the text to the clipboard. You could then use GetClipboard to assign the collected text to a variable and from there parse out the desired text. If you only want text that is in specific fields this method won't give that kind of result. You'd have to collect all text and have a method to parse it.

User avatar
Djek
Pro Scripter
Posts: 148
Joined: Sat Feb 05, 2005 11:35 pm
Location: Holland
Contact:

Re: Find text on a web page

Post by Djek » Sun Sep 03, 2017 7:29 am

hi,

you can also search direct in the webpage, without loading it in a variable,
depends on the default webbrowser you use,
try this

Code: Select all

// locate the word "Benefit"

let>SearchFor=Benefit
ExecuteFile>https://www.mjtnet.com/index.htm,1
WaitReady>0
wait>1
press CTRL
send>f
release CTRL
wait>0.2
send>%SearchFor%
press ENTER

kind regards,
Djek

Trevor Hughes
Junior Coder
Posts: 25
Joined: Sun Dec 15, 2013 9:27 pm

Re: Find text on a web page

Post by Trevor Hughes » Mon Sep 04, 2017 9:10 pm

Thank you for the help with this. I think that the CTRL F would be the best option for my situation.

I appreciate the help.

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