質問編集履歴
2
html情報の変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
import lxml
|
20
20
|
import time
|
21
21
|
|
22
|
-
html="https://www.
|
22
|
+
html="https://www.ymori.com/books/python2nen/test2.html"
|
23
23
|
load_html=requests.get(html)
|
24
24
|
|
25
25
|
soup=BeautifulSoup(load_html.text,"lxml")
|
1
title
CHANGED
File without changes
|
body
CHANGED
@@ -23,10 +23,10 @@
|
|
23
23
|
load_html=requests.get(html)
|
24
24
|
|
25
25
|
soup=BeautifulSoup(load_html.text,"lxml")
|
26
|
-
imgs=soup.find_all("
|
26
|
+
imgs=soup.find_all("img")
|
27
27
|
|
28
28
|
for i in range(len(imgs)):
|
29
29
|
filename="{}.jpg".format(i)
|
30
|
-
urllib.
|
30
|
+
urllib.request.urlretrieve(imgs[i]["src"],filename)
|
31
31
|
time.sleep(1)
|
32
32
|
```
|