faizzzsheikh wrote: ↑Wed Dec 02, 2020 1:58 pm
Code: Select all
iMaros: v12
Browser: Internet Explorer 11
OS: Windows 10
Hi... want to know if conditional css selector works with iMacros? I want to run a web scraper. The below selector is working with Web Scrape chrome extension, but it doesn't work with iMacros.
Selector:
Code: Select all
div.s-expand-height:has(span.a-price.a-text-price), .celwidget div.s-item-container:has(span.a-price.a-text-price), div.s-include-content-margin:has(span.a-price.a-text-price)
I tried this with iMacros in below formats, but not working
Format 1
Code: Select all
TAG POS={{!LOOP}} TYPE=DIV ATTR=CLASS:"s-expand-height:has(span a-price.a-text-price), celwidget s-item-container:has(span.a-price.a-text-price), s-include-content-margin:has(span.a-price.a-text-price)" EXTRACT=TXT
Format 2
Code: Select all
TAG POS={{!LOOP}} TYPE=DIV ATTR=CLASS:"div.s-expand-height:has(span.a-price.a-text-price), .celwidget div.s-item-container:has(span.a-price.a-text-price), div.s-include-content-margin:has(span.a-price.a-text-price)" EXTRACT=TXT
My complete iMacros script looks like this.
Code: Select all
SET !DATASOURCE E:\imacros\urllist1.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO={{!COL1}}
WAIT SECONDS={{!COL2}}
TAG POS={{!LOOP}} TYPE=DIV ATTR=CLASS:"s-expand-height:has(span.a-price.a-text-price), .celwidget s-item-container:has(span.a-price.a-text-price), s-include-content-margin:has(span.a-price.a-text-price)" EXTRACT=TXT
ADD !EXTRACT {{!URLCURRENT}}
'TAG POS={{!LOOP}} TYPE=DIV ATTR=CLASS:"s-expand-height s-include-content-margin s-border-bottom s-latency-cf-section" EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=E:\imacros FILE=data.csv
Alright, good-good-good...!, so you ARE interested after all to open a parallel Thread on "our" Forum, like I had "suggested" in your (original)
Thread on SOF, ah-ah...!
And yep, like I mentioned on SOF, I don't or very rarely answer Threads on that Forum because most Users for the 'iMacros' Tag usually delete their Qt/Thread once they've got their Answer, to avoid sharing with the "Competition", while I help Users for the "whole Community", so "here" you won't be able to delete your Thread, ah-ah...! (Reason I quote a bit "systematically"...)
Alright, FCI mentioned, hum..., correct Spelling is "iMacros" not the ugly malformed Word you "creatively" made for it...!
, and hum, iMB v12 is a bit vague, there are 3 iMB v12.x Versions, + x2 with 'Full'/'Trial' = 6 Combinations..., even if the 2 "oldest" v12.x Versions would sound a bit "strange" in 'Trial' Mode, but we still have 4 Possibilities..., => can you mention the exact Version...?
Then OK, I "see" that the '
TAG SELECTOR' Mode I have already mentioned on SOF was implemented
already in iMB v11.0, I "thought" it was more recent, ah-ah...! It is also implemented in v10.x for CR like I had mentioned, as you didn't mention your FCI on SOF and I "thought" I had understood you were on CR...
I've never used and "played" with that Mode actually, as I use for myself "older" Versions on FF (v8.8.2 + v8.9.7) where that Mode was not implemented yet...
Then well..., "next Step" would be if you can post at least one URL from your DataSource (or 2 or 3 would be even "better"), where you want to run your Script... Tja...!, I need "a bit logically" I would think, to be able to have a Look at the HTML Structure of the Page/Site if I want to "understand" a bit what you are trying to do, and to do any Testing myself, ah-ah...!
And hum..., could you also "translate" in "clear Wording" your "Requirements" about what all your "CLASS:"s-expand-height:has(span.a-price.a-text-price), .celwidget s-item-container:has(span.a-price.a-text-price), s-include-content-margin:has(span.a-price.a-text-price)"" etc are supposed to do...? Or is it "really" the 'CLASS' Attribute of that 'DIV' on the Page...? But hum..., looks a bit "strange" for a 'CLASS' ATTR to me...!?
+ Mention also "clearly", applied to at least the first URL you will mention, which HTML Elements you expect/want to tag and extract and what the expected Result should be...
(And today is my BDay, so I'll be "a bit busy", ah-ah...!
)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...