此图显示了我要访问的区域
containers = pagebs('div',{'class':"search-content"})
当我打印容器时,它只是显示
[<div class="search-content">
</div>]
里面什么都没有。我试着在里面搜索不起作用的标签 是否有解决方法,或者无论我做什么,我都无法访问它
这就是我到目前为止写的
from bs4 import BeautifulSoup as BS
from urllib.request import urlopen as uReq
url = 'https://bahrain.sharafdg.com/?q=asus%20laptops&post_type=product'
uclient = uReq(url)
pagehtml = uclient.read()
uclient.close()
pagebs = BS(pagehtml , 'html.parser')
containers = pagebs('div',{'class':"search-content"})
目前没有回答
相关问题 更多 >
编程相关推荐