我试图使用findall函数查找并打印一定数量的文本。我似乎无法使其正常运行。我试图再次使用findall函数来获取我想要的东西之前,先将所有信息打印并存储在变量中。我必须分两个步骤进行操作,因为如果我直接搜索src,则会从文档的其他区域收到其他垃圾邮件。
到目前为止,这是我所做的。
## locate a section of text containging the img source
html_img_source_and_junk = findall('</noscript>[\s]+<img[\s]+src="([^"]+)"[\s]+alt', html_source_whittakers)
print(html_img_source_and_junk)
这是我试图提取的信息文本。
noscript>
src="//cdn.shopify.com/s/files/1/0274/7315/products/whi_225x225.jpg?v=1525431190"
alt="