Get the value of the label property which method

Acquiring process inside tag attribute values, (below which the label is to obtain a value of the property source-data-lazy-img) of

soup2 = BeautifulSoup(span.encode('utf-8'), 'html.parser')
for img2 in soup2.find_all('img',{"source-data-lazy-img":True}):
  print img2["source-data-lazy-img"]

Source  https://cloud.tencent.com/developer/ask/141071

 

Get has the property tag corresponding to the value of

print 'prices of commodities:' + img2.text

Guess you like

Origin www.cnblogs.com/kaibindirver/p/10934865.html