因此,作为 mechanize 的替代品,因为 Visual Studio“需要”python 3.4,并且 mechanize 与 3.4 不兼容,我发现“robobrowser”作为替代品,但我无法弄清楚为什么 browser.open 返回“ AttributeError:“模块”对象没有属性“打开””
import re
from robobrowser import browser
import time
br = browser
br.open("Website")
br.select_form(name="game-pin-input")
print ("Enter the game pin")
response = br.submit()
time.sleep(3)
有什么建议或替代品吗?
编辑:文档可以在这里找到,“open”是有效的。 https://robobrowser.readthedocs.org/en/latest/api.html#module-robobrowser.browser