I'm trying to prefill webforms in iframes using Requests. If that can't be done, does anyone have a script I can use that works with webbrowser? I like that it calls the default web browser in just about any system, which is great for my Android applications.
I've tried using splinter, a wrapper to selenium, but it only opens the browser--firefox only--for a second, fills out the iframe, and then automatically closes. Below is my splinter code.
with Browser() as browser:
r = browser.find_by_id('inpage_to_email').fill('firstname.lastname@example.org')
but it only opens the browser--firefox only--for a second, fills out the iframe, and then automatically closes.
I believe this is because the context manager in this case destroys the browser instance the moment it goes out of scope (i.e. as soon as you exit the with block). You can test this out by removing the with block and using your code like:
browser = Browser()
# other stuff
Yeah, I figured it out eventually. Thank you for taking the time to answer the question, btw. I should've come back to answer once I figured it out, so I apologize for that.
So splinter works, but the problem is that it won't work on my android device. Back to the drawing board.
Again, thank you!