I'm trying to get a basic web scraping script running just to test some things out and I noticed a lot of people recommending the "requests" package so I downloaded it but I am getting some weird responses and I'm hoping someone could help me interpret them as I am very new to python
import requests
r = requests.get('http://www.python.org')
r.content
and the output is this:
C:\Python32\python.exe "D:/Code Testing/Missing Time/webscraper.py"
Traceback (most recent call last):
File "D:/Code Testing/Missing Time/webscraper.py", line 1, in <module>
import requests
File "C:\Python32\lib\site-packages\requests-2.11.1-py3.2.egg\requests\__init__.py", line 52, in <module>
from .packages.urllib3.contrib import pyopenssl
File "C:\Python32\lib\site-packages\requests-2.11.1-py3.2.egg\requests\packages\__init__.py", line 39, in <module>
from . import idna
File "C:\Python32\lib\site-packages\requests-2.11.1-py3.2.egg\requests\packages\idna\__init__.py", line 1, in <module>
from .core import *
File "C:\Python32\lib\site-packages\requests-2.11.1-py3.2.egg\requests\packages\idna\core.py", line 10
_unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]')
^
SyntaxError: invalid syntax
The requests module, version 2.11.1, doesn't support Python 3.2 - see the end of their PyPI page . You have a few options:
There are some very real downsides to running old versions of libraries, namely missing features and the possibility of security vunerabilities . This is not a theoretical possibility - see this CVE for example. For more details, see requests vulnerability disclosure page .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.