【发布时间】:2021-11-26 14:46:51
【问题描述】:
我想用 python 正确地刮取孟加拉语字符。我已经尝试解码它,但它给了我一个错误,而我编码它给了我一些不可读的东西
from bs4 import BeautifulSoup
import requests
import urllib3
import requests
import pprint
import json
from requests.models import DecodeError
from urllib3.util.url import Url
content = []
# for i in range(1, 25):
url = 'https://sattacademy.com/job-solution/view?cat_id=1&sub_cat_id=893'
res= requests.get(url)
soup = BeautifulSoup(res.text, 'html.parser')
anchor = soup.findAll("a", attrs={"class": "nav-link"})
for ref in anchor:
print(ref.text)
这是我的输出 -> enter image description here
但我想要这个 clearry.Thnx
【问题讨论】:
-
你好,你能发一张
ref.text值的图片吗? -
@Hamed 我在我的输出链接中发送它请检查它thnx
标签: python web-scraping