docker-gitbook-pdf-generator icon indicating copy to clipboard operation
docker-gitbook-pdf-generator copied to clipboard

爬取失败,报错 AttributeError: 'NoneType' object has no attribute 'xpath'

Open waynezhao12 opened this issue 7 months ago • 0 comments

crawling : http://www.autolabor.com.cn/book/ROSTutorials/di-7-zhang-ji-qi-ren-dao-822a28-fang-771f29/104-ben-zhang-xiao-jie.html Traceback (most recent call last): File "/app/gitbook.py", line 303, in Gitbook2PDF(url).run() File "/app/gitbook.py", line 192, in run loop.run_until_complete(self.crawl_main_content(content_urls)) File "/usr/local/lib/python3.7/asyncio/base_events.py", line 583, in run_until_complete return future.result() File "/app/gitbook.py", line 214, in crawl_main_content await asyncio.gather(*tasks) File "/app/gitbook.py", line 235, in gettext text = ChapterParser(metatext, title, level, ).parser() File "/app/gitbook.py", line 92, in parser if tree.xpath('//section[@Class="normal markdown-section"]'): AttributeError: 'NoneType' object has no attribute 'xpath'

请问如何解决?

waynezhao12 avatar May 21 '25 03:05 waynezhao12