Search code examples
pythonwebsplinter

python: how to go "back" a page with splinter


I need to iteratively submit data to a page then re-visit the page:

from splinter import Browser

with Browser() as browser:
        # Visit URL
        url = "http://tefam.biochem.vt.edu/tefam/search_seq_form.php"
        browser.visit(url)

Instead of repetitively revisiting, how do I simply go "back" to the previous page?


Solution

  • Using the Browser back() method:

    browser.back()
    

    This will back to the last visited URL in the history as described in the API documentation.