Page 1 of 1

Iframe

Posted: Wed Apr 11, 2018 3:28 pm
by skivancouver
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.

Re: Iframe

Posted: Thu Apr 12, 2018 4:54 pm
by webmaster
Does this frame happen to be on the same domain as the main frame?

Re: Iframe

Posted: Fri Apr 13, 2018 7:27 am
by webmaster
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).

Re: Iframe

Posted: Mon Jan 24, 2022 3:36 pm
by yeti
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.

Re: Iframe

Posted: Fri Jan 28, 2022 11:21 am
by webmaster
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).