Iframe

Questions & Answers about Helium Scraper 3
Post Reply
skivancouver
Posts: 1
Joined: Wed Apr 11, 2018 3:25 pm

Iframe

Post by skivancouver » Wed Apr 11, 2018 3:28 pm

Hi there, tested the scraper and it isnt able to identify an element within a frame. Once this is fixed, the memory issue was my other problem with the old version.

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Iframe

Post by webmaster » Thu Apr 12, 2018 4:54 pm

Does this frame happen to be on the same domain as the main frame?
Juan Soldi
The Helium Scraper Team

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Iframe

Post by webmaster » Fri Apr 13, 2018 7:27 am

Anyway, the latest version (3.0.9.5) supports iframes seamlessly when they're on the same domain. If they're not (you'll notice because you won't be able to select elements inside), the simplest solution would be to have the browser navigate to the iframe's src (if you select the iframe you'll see the src attribute under the HTML value).
Juan Soldi
The Helium Scraper Team

yeti
Posts: 22
Joined: Sat Feb 02, 2013 1:01 am

Re: Iframe

Post by yeti » Mon Jan 24, 2022 3:36 pm

I am also attempting to access data inside of an iframe. The iframe is on another domain and I have the exact URL of the iframe for the specific item (it is different for every item scraped) inside of a Text as collected when scraping the page.

I am wondering how to tell the browser to navigate to the URL of the iframe from the URL collected inside of the Text, rather than needing to enter the exact URL into the Browser.Navigate [url]?

I currently have:

Code: Select all

iframe_link
   Select.Iframe
   Text.Iframe_url
This gets the exact iframe URL.

And I have tried:

Code: Select all

child
   Select.Iframe
   Text.Iframe_url
   Browser.Navigate
   extract
      itemdescription
         Select.Description_raw
Which doesnt seem to work.

How would I get the browser to now visit this specific URL to get the data inside of it?

I have been trying a few different methods including using a Script, though with my limited understanding the result is seemingly always empty.

I have also tried to copy the method that tells the browser to navigate the item title, to load the item page, however it does not work, probably as the URL in this case is not a 'link' and is just 'text'?

Any help would be appreciated.

Thank you.

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Iframe

Post by webmaster » Fri Jan 28, 2022 11:21 am

You're pretty close. Just right-click Text.Iframe_url and select Output Result (or alternatively, left-click it and press the space bar). A placeholder [name] at the bottom will appear:

Code: Select all

Text.Iframe_url
as [name]
Then replace the [name] placeholder with a variable name, such as url, and finally replace your Browser.Navigate with a Browser.Load that takes the url variable. It should look like this:

Code: Select all

Select.Iframe
Text.Iframe_url
as url
Browser.Load
   ·  url
In general, you can output anything into a variable using this method, and you can always use Sequence.Log to see what's in any variable (you can see the log at Project > Log).
Juan Soldi
The Helium Scraper Team

Post Reply