How do i check if text exists on a website

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

How do i check if text exists on a website

by direwolf38 on Tue Mar 14, 2017 8:44 am

I need to check if some text exists on a website using javascript, how would i do this?

I've seen some posts saying use "document.". That doesn't work.
Some said use "window.document". That throws an error saying it's not supported in multiprocess firefox.

I've also found this:

Code: Select all
var macro;

macro ="CODE:";
macro +="SET !ERRORIGNORE YES"+"\n";
macro +="TAG POS=1 TYPE=HTML ATTR=TXT:* EXTRACT=TXT"+"\n";

iimPlay(macro)

var text=iimGetLastExtract();

if(text.search("Hello World")!=-1)
{
    alert("Found the text");
}


^That just runs the script...and it finishes. It doesn't throw an error, but it also doesn't "alert" that it found the text. It just runs and finishes.

So how could i do this?
direwolf38
 
Posts: 1
Joined: Tue Mar 14, 2017 8:40 am

Return to iMacros for Firefox

Who is online

Users browsing this forum: Bing [Bot] and 7 guests

-->