Python系列:Python 使用xpath遇到问题 ValueError: can only parse strings
Python 使用xpath遇到问题 ValueError: can only parse strings
Python 使用xpath遇到问题 ValueError: can only parse strings
从零开始入坑爬虫,记录一下遇到的问题
源代码:
import requests
from bs4 import BeautifulSoup as bf
from lxml import etree
url = 'http://movie.douban.com/top250/'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36'