问题
guys, actually I have a problem in my code and the redirection feature in my router, after I wrote the code which able to find the form and login into the router I faced a problem that after the login using the login.cgi the router redirects the link into something like http://192.168.1.2/index.asp;session_id=2dfa2490ad2e26a3d073edfdae7d0f45 what I could understand that it shows the session id in the link and I need help to make my code understands and gets the link I tried many times using browser.get_url() but it shows http://192.168.1.2/login.cgi
thank you guys
def wifi_pass_changer():
username = 'admin'
password = 'admin'
url = "http://192.168.1.2/"
browser = mechanicalsoup.StatefulBrowser()
browser.open(url)
browser.select_form('form[action="login.cgi"]')
browser["http_username"] = username
browser["http_passwd"] = password
response = browser.submit_selected()
来源:https://stackoverflow.com/questions/46893406/python-mechanicalsoup-redirection-issue