【发布时间】:2023-03-31 09:11:02
【问题描述】:
我正在尝试读取一些名称和 ID,例如:
<a class="inst" href="loader.aspx?ParTree=151311&i=3823243780502959"
target="3823243780502959">رتكو</a>
i = 3823243780502959
等等,来自tsetmc.com。这是我的代码:
import requests
from bs4 import BeautifulSoup
url = 'http://www.tsetmc.com/Loader.aspx?ParTree=15131F'
page = requests.get(url)
soup = BeautifulSoup(page.content , 'html.parser')
first_names_Id = soup.find_all('a',class_='isnt' )
print (first_names_Id)
但它返回None。
如何阅读这些标签?我对其他标签也有同样的问题。
【问题讨论】:
标签: python beautifulsoup tags