Forum Archive

Automate a web page —> click on links and buttons and scrape information.

wayland

Is it possible to use Pythonista as a bot? I’ve been given some repetitive tasks from my boss that involves clicking links in a web page. I have worked out how to do that on a Mac with AppleScript and Safari, but is this possible with Pythonista on an iPad? How would I get Pythonista to open up a web page and start click on links or buttons?

JonB

If you don't need JavaScript to run, you can just use requests to scrape pages and send get or post requests on links.

Otherwise, you can use a webview or @mikael's WKWebView wrapper, and inject JavaScript to simulate link clicking...

mikael

@wayland, link to the WKWebView wrapper.