-1
#page source for bs4
html = wd.page_source
soup = BeautifulSoup(html, "html.parser")
thumbnail = (soup.find('div', attrs={ "class" : "preview"}))
[<div class="preview">
<img alt="eye.jpg" src="https://thumb-service.domain.net/?sign=d85565637ccacf35673008b12871db54&cdb=CPM&fid=86274&size=120&format=jpg&mtd=maxs&mtdp=&fp=&ts=1461315108317" title="eye.jpg">
</img></div>]
我想只是&爲&的SRC,我已經搜索並嘗試了各種建議,但我不能讓這個
你的意思是你想要的'src'屬性的值,轉義?導航到元素並提取屬性。您是否閱讀了手冊的[*導航樹*部分](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#navigating-the-tree)?如果你這樣做,你卡在哪裏? –
你的輸出表明你使用'soup.find_all()',而不是'soup.find()'。你有一個* list *,其中有一個元素,而不僅僅是一個元素。 –