ashbythorpe / selenider

Concise, Lazy and Reliable Wrapper for 'chromote' and 'selenium'
https://ashbythorpe.github.io/selenider/
Other
32 stars 2 forks source link

Selenider switch_to_frame #23

Closed AntonioBergallo closed 4 months ago

AntonioBergallo commented 4 months ago

Good evening! I am far from an expert in webscrapping, but I have some codes written in Rselenium that I've been trying to adapt to selenider, as it has maintenance and is more efficient overall. However, I've been struggling to figure out how to access elements inside frames. Using selenium-r, I can easily adapt this code with the switch_to_frame method, but I can't work a way to insert this in a selenider script. I do think that should be a way to do it, as selenider is a wrapper itself for selenium-r, but I'd appreciate some help!

ashbythorpe commented 4 months ago

You can get the selenium session from the selenider one using $driver. For example:

library(selenider)

session <- selenider_session("selenium")

session$driver$switch_to_frame(...)
AntonioBergallo commented 4 months ago

Thanks a lot for the answer! And sorry for the rather silly question. Great package you developed, appreciate it a lot.

ashbythorpe commented 4 months ago

Not a silly question at all! I want to make a vignette that covers this when I have time because I don't think it's documented well at the moment.