On Behalf of @Focalav: SEARCH SOURCE=REGEXP "Next target: <b>6 seconds</b>"

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
chivracq
Posts: 9318
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

On Behalf of @Focalav: SEARCH SOURCE=REGEXP "Next target: <b>6 seconds</b>"

Post by chivracq » Thu Mar 05, 2020 10:16 pm

Alright...!, stg I very rarely do, but I'm posting/creating this Thread on Behalf of a "New" User who tried to post about 1 week ago and I disapproved their Post/Thread because they didn't read the Forum Rules and used a "completely useless" :shock: (=Non-Descriptive) Thread Title (=> “imacros question”, yep, very "cute" indeed, oops...! :P ), and I "thought" they would reopen their Thread with the "Minimum Required Quality", but..., hum..., nope, ah-ah...! :o

The overall/average Quality of Threads I disapprove is usually pretty Low, (and I'm not even talking about all Spam and Fake Posts from self-proclaimed SEO Experts who want to advertise for their Site in their Sig, ah-ah...!, but for "Legit" Posts I regularly have to disapprove, the 3 main Reasons are "Wrong Sub-Forum" + "Non-Descriptive Thread Title" + "Screenshot(s) uploaded to some external Pix Hosting Site"), but this one contained some "interesting" Research by this User, so I'm still creating a Thread for them... 8)
Disapproved topic “imacros question” written by “Focalav” for the following reason
»

Post/Thread disapproved, User notified, Reason:
"Useless Thread Title...!"

"but help there is hit and miss"
=> Yep indeed, for Users who don't read the Forum Rules and don't use the Forum "correctly"...

- You can reopen your Thread with a DESCRIPTIVE Thread Title. (This part is Blocking for Approval.)
- The 'Data Extraction' Sub-Forum would btw be more "appropriate"/specific than the 'General' one that you chose. (This is now Blocking also as I've mentioned it...)
- Mention your FCI. (Not Blocking for Approval but helps bypass the "hit and miss"...)

The rest of the Post is "Good Quality" and the Qt is interesting actually...

(And correct Spelling is "iMacros"...)

>>>
Post details
imacros question
Posted by Focalav » 27/02/2020 - 18:46

HI all Im trying to do a data extract from a specific loaction, for a random bit of data using imacros.
Im trying to use a SEARCH SOURCE=REGEXP query but the query structure is a mystery to me.
Ive read: http://wiki.imacros.net/SEARCH
but this doesn't explain enough so that I can figure out how to make it useful in building my own query.

A sample bit of the source webpage is:

Code: Select all

<table cellpadding=0 cellspacing=0><tr><td width="220px"><div style="width:200; height:25; background:url(/images/timedcombat-background.png); border:1px solid #000000;"></div></td><td>Next target: <b>6 seconds</b></i></td></tr></table>
So Ive tried: a whole bunch of stuff trying to figure out how the query structure works but I haven't go it.

Imacros Notes on using SEARCH REGEXP

Code: Select all

SEARCH SOURCE=REGEXP:"target:..[^]" EXTRACT=$1 | gives: undefined
SEARCH SOURCE=REGEXP:"target:..[^s]" EXTRACT=$1 | gives: undefined
SEARCH SOURCE=REGEXP:"target:..[^0-9]" EXTRACT=$1 | gives: undefined
SEARCH SOURCE=REGEXP:".*target..([0-9]+)" EXTRACT=$1 | gives: Source Doesnt match target
SEARCH SOURCE=REGEXP:"target..([0-9]+)" EXTRACT=$1 | gives: Source Doesnt match target
SEARCH SOURCE=REGEXP:"target:..([0-9]+)" EXTRACT=$1 | gives:Source Doesnt match target
SEARCH SOURCE=REGEXP:"target:..([^0-9]+)" EXTRACT=$1 | gives:Source Doesnt match target
SEARCH SOURCE=REGEXP:"target:..([^0-9])" EXTRACT=$1 | gives: b
SEARCH SOURCE=REGEXP:"target:.([^0-9])" EXTRACT=$1 | gives: <
SEARCH SOURCE=REGEXP:"target:([^0-9])" EXTRACT=$1 | gives: Blank, literaly, the space character I think..
SEARCH SOURCE=REGEXP:"target:?([^0-9])" EXTRACT=$1 | gives: ;
SEARCH SOURCE=REGEXP:"target:?.([^0-9])" EXTRACT=$1 | gives: <
SEARCH SOURCE=REGEXP:"target:?.([^0-9])" EXTRACT=$1 | gives: Blank, literaly, the space character I think..

Code: Select all

SEARCH SOURCE=REGEXP:"target:?.([^0-9]+)" EXTRACT=$1
... => | gives: UGH,.. some part of the Imacros source code?

Code: Select all

var altKey;
var ctrlKey;
var metaKey;
if (window.event != null) {
c=String.fromCharCode(window.event.keyCode).toUpperCase();
altKey=window.event.altKey;
ctrlKey=window.event.ctrlKey;
metaKey=window.event.metaKey;
}else{
c=String.fromCharCode(e.charCode).toUpperCase();
altKey=e.altKey;
ctrlKey=e.ctrlKey;
metaKey=e.metaKey;
}
if (window.event != null)
target=window.event.srcElement;
else
target=e.originalTarget;
if (target.nodeName.toUpperCase()=='INPUT' || target.nodeName.toUpperCase()=='TEXTAREA' || altKey || ctrlKey || metaKey){
}else{
if (c == '
So Then I decided I need help. Yes, I'm on the imacros forums, but help there is hit and miss.
is there documentation of how exactly to form Search Source queries using imacros? Or does anyone use Imacros, and could explain this to me.

So, here it is... 8)
I won't "try" to answer it (even if there are some much easier/simpler Solutions) as the User didn't "follow up" on my Disapproval by reopening their Thread with some "correct" Quality, but I found the Research part with all different 'SEARCH' Statements and their Results quite interesting though :P , and worth sharing on the Forum... 8)

And I've reformatted a bit the Post, especially about the very last 'SEARCH' Statement that I separated from the previous ones, which seems to retrieve some iMacros Core Code about the 'EVENT' Mode... Hum..., strange indeed... :? :twisted:

>>>

@OP (= @Focalav), you are still "welcome" to post in this Thread if you "notice" it, you won't be able to take Ownership of this Thread, but if you post in it, you'll be able to get Notifications..., and I might still help you if you follow up "a bit correctly" and also mention your FCI like I already asked you... :idea:
(But don't try to create your own Thread now (about the same Qt), that would be a Duplicate, and I wouldn't approve it anyway, you had 1 week already to do so, now it's too late, sorry... :| )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply