> >>> br.select_form(nr=-6ren">
gpt4 book ai didi

Python/Mechanize - 无法选择表单 - ParseError(exc)

转载 作者:太空宇宙 更新时间:2023-11-04 11:02:30 26 4
gpt4 key购买 nike

我收到此错误:

>>> br = Browser()
>>> br.open("http://www.bestforumz.com/forum/")
<response_seek_wrapper at 0x21f9fd0
whose wrapped object =
<closeable_response at 0x21f9558 whose
fp = <socket._fileobject object at
0x021F5F30>>>
>>> br.select_form(nr=0)

Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
br.select_form(nr=0)
File "build\bdist.win32\egg\mechanize\_mechanize.py", line 505, in select_form
global_form = self._factory.global_form
File "build\bdist.win32\egg\mechanize\_html.py", line 546, in __getattr__
self.forms()
File "build\bdist.win32\egg\mechanize\_html.py", line 559, in forms
self._forms_factory.forms())
File "build\bdist.win32\egg\mechanize\_html.py", line 228, in forms
raise ParseError(exc)
ParseError: <unprintable ParseError object>

请帮帮我

谢谢

最佳答案

我告诉你这是我用来解析 html 的一些 secret (目标是通过 Mechanize 强制解析 html)

br = mechanize.Browser(factory=mechanize.DefaultFactory(i_want_broken_xhtml_support=True))

关于Python/Mechanize - 无法选择表单 - ParseError(exc),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4062250/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com