from urllib.request import urlopen
from urllib.request import urlretrieve
from bs4 import BeautifulSoup
html = urlopen("http://www.pythonscraping.com")
bsObj = BeautifulSoup(html,'html.parser')
imageLocation = bsObj.find('a',{'id':'logo'}).find("img")['src']
urlretrieve(imageLocation,'G:\\logo.jpg')
这段程序的.find("img")['src'] 最后加的这个【‘src’】是什么意思
from urllib.request import urlretrieve
from bs4 import BeautifulSoup
html = urlopen("http://www.pythonscraping.com")
bsObj = BeautifulSoup(html,'html.parser')
imageLocation = bsObj.find('a',{'id':'logo'}).find("img")['src']
urlretrieve(imageLocation,'G:\\logo.jpg')
这段程序的.find("img")['src'] 最后加的这个【‘src’】是什么意思