PYTHON 3 crawler has the problem of

Python3 teaches by hand
Official Python Manual
The problem
When writing crawlers in Python, I encountered an error of Urlopen:

>>> url = """
... ...
<urlopen error no host given>

There are many reasons for this problem. For example, in order to prevent program access, some websites need to add headers, etc., in order to access normally, otherwise this error will be reported.
The solution
In fact, careful friends will find me above the code for elegance, with “” “” “” to continue line, and with the return to the URL path to truncate. So here’s the problem — this is the same as introducing the ‘/n’ character into the original URL string, so the path is wrong, so it won’t open!
As long as you don’t press enter, you can resume the normal use of urllib.request-open.
(Question: But how do you achieve line wrapping in this case?Just use ‘a’ + ‘b’ + ‘c’ ~)

Read More: