Jump to content

Find text on web page in Chrome


danusko
 Share

Recommended Posts

Hi, 

i tried search to solve my problem but i wasnt succsessfull. 

I try to check, if any text on web page exists. 

i tried a lot of scripts, but nothings worked. 

Local $text = WinGetText("[Chrome_WidgetWin_1]", "get")
 MsgBox(0, "Text read was:", $text)

my last try is this:

Local $text = ControlGetText(WinGetTitle("Checking if Text Exists"), "Text", "[CLASS:Chrome_WidgetWin_1; INSTANCE:1]")

 

I try to check if text "text" exists on the page. But this return blank. But on the page wich i try is this "text". 

 

Any suggestions?

thx a lot

Link to comment
Share on other sites

3 hours ago, danusko said:

So it doesnt exists solution in Autoit existing commands? it is neccsessary to use this drivers and exe files and so?

im not well versed but my understand is microsoft has switched to a new framework and autoit won't work natively for alot of new app anymore but there is project for it, you might want to look into IUIAutomation.

now as far as chrome goes it is 'dom' not the same as your typical windows app. so other chrome udfs and webdriver is required to communicate with chrome. Chrome by default do support 'chrome native messenging' which accept external JavaScript input and spit out output in the form of input.txt and output.txt -think window cmd/command line but with JavaScript. here is alternative chrome udf  might want to read first several pages or all for updated fixes to setup correct. you can get texts or even automate login to website from autoit. let me know over there if you have questions. 

 

5 hours ago, danusko said:

I try to check if text "text" exists on the page. But this return blank. But on the page wich i try is this "text". 


Local $text = ControlGetText(WinGetTitle("Checking if Text Exists"), "Text", "[CLASS:Chrome_WidgetWin_1; INSTANCE:1]")

 

with that, you are not using ControlGetText() correctly. try this on notepad.exe and bring up 'save as' window type something into 'file name:' then run the code below. See attached screenshot

Local $text = ControlGetText("[CLASS:#32770; TITLE:Save As]", 'Edit1')
MsgBox(0, 'File Name is:', $text)

 

5 hours ago, danusko said:

i tried a lot of scripts, but nothings worked. 


Local $text = WinGetText("[Chrome_WidgetWin_1]", "get")
 MsgBox(0, "Text read was:", $text)

again you did have it setup correctly. try this in new notepad.exe, type something in it then run the code bellow

Local $text = WinGetText("[CLASS:Notepad; TITLE:Untitled - Notepad]")
 MsgBox(0, "Text read was:", $text)

 

window_info_demo.png

Link to comment
Share on other sites

5 hours ago, danusko said:

For Notepad it is working but i need it for Chrome.

it's intended to demonstrate how to get those functions working.

5 hours ago, danusko said:

i understand, that its not so easy to make it for chrome.

everything has a limit it's not about easy or hard

5 hours ago, danusko said:

I dont wanted to use some other programs or exe files to achive my goals. 

if your goal is to work with live webpage preloaded in chrome you don't have any other options. you have to understand that web developers or a like are the people need to work with web browsers professionally and that is how they came up with the tools.

if you just need to quickly go on to a website to check a status of a particular thing. you might want to look in to _INetGetSource(), _IEDocReadHTML(). again just so you understand, these udfs were developed -thought you might not see- using existing exe called 'internet explorer'. there' also WinHTTP udf and wget (external exe) 

or do a select all > copy using Send() and ClipGet() then StringRegExp() 

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...