座井观天
2021-04-25 16:35
采纳率: 100%
浏览 112
已采纳

我的requests-html模块怎么了?

 from requests_html import HTMLSession
  File "C:\Users\凡人\AppData\Local\Programs\Python\Python39\lib\site-packages\requests_html.py", line 11, in <module>
    from pyquery import PyQuery
  File "C:\Users\凡人\AppData\Local\Programs\Python\Python39\lib\site-packages\pyquery\__init__.py", line 5, in <module>
    from .pyquery import PyQuery  # NOQA
  File "C:\Users\凡人\AppData\Local\Programs\Python\Python39\lib\site-packages\pyquery\pyquery.py", line 12, in <module>
    import lxml.html
  File "C:\Users\凡人\AppData\Local\Programs\Python\Python39\lib\site-packages\lxml\html\__init__.py", line 87, in <module>
    _rel_links_xpath = etree.XPath("descendant-or-self::a[@rel]|descendant-or-self::x:a[@rel]",
AttributeError: 'function' object has no attribute 'XPath'

本人分别在pycharm和vscode中测试了都报出这样的问题.请高手给予指点.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

3条回答 默认 最新

相关推荐 更多相似问题