Skip to content

Commit 36fdc7d

Browse files
authored
Add files via upload
1 parent fe64b0b commit 36fdc7d

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

GI.PY

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from selenium import webdriver
2+
from selenium.webdriver.chrome.options import Options
3+
from bs4 import BeautifulSoup
4+
import requests
5+
import time
6+
7+
chrome_options = webdriver.ChromeOptions()
8+
chrome_options.add_argument("--incognito")
9+
driver = webdriver.Chrome(r"C:\chromedriver")
10+
x=0
11+
driver.get("https://www.flipkart.com")
12+
13+
content = driver.page_source
14+
soup =BeautifulSoup(content,features="html.parser")
15+
for a in soup.findAll('a',href=True):
16+
if a.img:
17+
try :
18+
url =a.img['src']
19+
r = requests.get(url)
20+
x+=1
21+
f=open("%s.jpg"%x,'wb')
22+
f.write(r.content)
23+
24+
25+
except Exception:
26+
continue
27+
print(x)

0 commit comments

Comments
 (0)