补全爬取的url

有时爬取到的href不全,如href=‘/11031/’
解决方法:

from urllib import parse
url=parse.urljoin(response.url,get_url)
response.url 正在爬取的网页的url
get_url 网页中条目的url

原文地址:https://www.cnblogs.com/cekong/p/9995255.html