If statement to check if there is text on a webpage?

Advanced programming using WinTask scripting language

If statement to check if there is text on a webpage?

Postby Betty on Mon Feb 10, 2014 2:04 pm

Hi,
how do I check if the text on the page contains "Bla Bla"?
Betty
 
Posts: 22
Joined: Thu May 12, 2005 11:21 am

Re: If statement to check if there is text on a webpage?

Postby TechSupport on Tue Feb 11, 2014 9:22 am

Hello,

If the text is within an HTML object, you can use Spy tool to find the HTML descriptor of the object and then use ExistHTMLElement function to test if the object is there or not.

If the text cannot be related to an HTML object, you can use GetPageSource$ to retrieve all the page content, and then using InStr function, you can test if a specific text is or is not within the long string returned by GetPageSource$.

Best regards.
WinTask Tech Support
TechSupport
 
Posts: 805
Joined: Thu Nov 16, 2006 9:58 am


Return to Scripts programming

Who is online

Users browsing this forum: No registered users and 1 guest