Код: Выделить всё
from scrapy import Selector
# Import requests
import requests
url = 'https://en.wikipedia.org/wiki/Pakistan'
# Fetch the HTML content of the webpage
response = requests.get(url)
# Create the Selector object sel from html
sel = Selector(text=response.text)
# Print out the number of elements in the HTML document
print("You have found:", len(sel.xpath('//*')))
введите описание изображения здесь
Я попробовал переустановить модуль Scrappy и проверил версию Python. Но все равно ошибка.
Подробнее здесь: https://stackoverflow.com/questions/784 ... -in-python
Мобильная версия