V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
bestehen
V2EX  ›  Python

Python 报错 如何解决?

  •  
  •   bestehen · 2018-08-16 15:06:38 +08:00 · 1416 次点击
    这是一个创建于 2071 天前的主题,其中的信息可能已经有所发展或是发生改变。
    5 ('Connection aborted.', BadStatusLine("''",))
    266 Traceback (most recent call last):
    267 File "/home/shenjianlin/log/my_project/run.py", line 58, in <module>
    268 run().get_spider()
    269 File "/home/shenjianlin/log/my_project/run.py", line 54, in get_spider
    270 qimingpian().get_id_and_front_url()
    271 File "/home/shenjianlin/log/my_project/qimingpian_person/qimingpian_person.py", line 181, in get_id_and_front_url
    272 self.get_agency_content(row_column_list[i], row_column_list[i+1], auth, proxies,user_index)
    273 File "/home/shenjianlin/log/my_project/qimingpian_person/qimingpian_person.py", line 408, in get_agency_content
    274 if len(etree.HTML(org_content).xpath('//div[@class="info"]/a/span[@class="name"]/text()')) == 1:
    275 UnboundLocalError: local variable 'org_content' referenced before assignment
    3 条回复    2018-08-22 00:40:53 +08:00
    xiaobai987
        1
    xiaobai987  
       2018-08-16 15:33:01 +08:00
    xiaobai987
        2
    xiaobai987  
       2018-08-16 15:34:26 +08:00
    建议楼主从基础看起 基础很重要
    bestehen
        3
    bestehen  
    OP
       2018-08-22 00:40:53 +08:00
    @xiaobai987 一边去
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3934 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 04:17 · PVG 12:17 · LAX 21:17 · JFK 00:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.