nateshmbhat / webbot

Web automation library for simple and easy end to end testing and web browser automation that offers super charged features while keeping it simple to use and master
https://pypi.org/project/webbot/
Mozilla Public License 2.0
239 stars 87 forks source link

Can't find an element by ID even though it's there. #34

Closed doodhJalebi closed 4 years ago

doodhJalebi commented 4 years ago

Hey,

Firstly, a brilliant job on the API. It's really nice and simple and gets work done! I'm using it to scrap some data off of a web-app that didn't have an API of its own.

Here's the issue: I'm trying to click a link which has its ID, name, text, href and more stuff as well. I can see it rendered on the page, I can see it while inspecting the page in Chrome and it has all the attributes stated before. But for some reason, webbot can't seem to find it (tested using browser.find_elements) or click on it.

Can you please help me out here? Is this a legitimate bug?

james-e-morris commented 4 years ago

@doodhJalebi is your element within an iFrame? I'm only just now looking at webbot, but I have worked with selenium quite a bit and there is no way to access elements within an iFrame unless you use browser.switch_to_frame(frame_name)

I don't see any frame switching in the webbot code, so I would guess that feature isn't included

doodhJalebi commented 4 years ago

@Glorypants I ended up giving up on webbot and switched to selenium. Faced the same issue there and ended up learning about iframes and frame switching. Got it to work in the end so it's all good!