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
gayu
V2EX  ›  Python

打不开目标网址,萌新求解答

  •  
  •   gayu · 2016-10-25 23:11:01 +08:00 · 1695 次点击
    这是一个创建于 2738 天前的主题,其中的信息可能已经有所发展或是发生改变。
    是这样的,我想要通过这个网址 https://diviner.jd.com/diviner?lid=1&p=103003&sku=676676 来实现对内容的提取,可是我在测试的时候就报错。具体如下:
    D:\Python27.1\python.exe D:/Users/Administrator/PycharmProjects/untitled5/1122.py
    File "D:/Users/Administrator/PycharmProjects/untitled5/1122.py", line 4
    html=requests.get( https://diviner.jd.com/diviner?lid=1&p=103003&sku=676676,headers=head)
    ^
    SyntaxError: invalid syntax

    Process finished with exit code 1
    不知道是网址的问题还是什么,求帮忙
    karenn
        1
    karenn  
       2016-10-25 23:34:09 +08:00   ❤️ 1
    get 函数里面的内容要加引号
    aitaii
        2
    aitaii  
       2016-10-26 09:14:05 +08:00   ❤️ 1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5337 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 08:47 · PVG 16:47 · LAX 01:47 · JFK 04:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.