-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 *,其中有一个元素,而不仅仅是一个元素。 –