Delete main.py
Browse files
main.py
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
import time
|
2 |
-
from bs4 import BeautifulSoup
|
3 |
-
from selenium import webdriver
|
4 |
-
from selenium.webdriver.chrome.service import Service
|
5 |
-
from selenium.webdriver.chrome.options import Options
|
6 |
-
from webdriver_manager.chrome import ChromeDriverManager
|
7 |
-
print("load complete")
|
8 |
-
chrome_options = Options()
|
9 |
-
chrome_options.add_argument('--no-sandbox')
|
10 |
-
chrome_options.add_argument('--headless')
|
11 |
-
chrome_options.add_argument('--disable-gpu')
|
12 |
-
chrome_options.add_argument('--disable-dev-shm-usage')
|
13 |
-
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()),options=chrome_options)
|
14 |
-
print("driver start")
|
15 |
-
url= 'https://navpan2-dockerbot.hf.space/'
|
16 |
-
driver.get(url)
|
17 |
-
print("sleep me")
|
18 |
-
time.sleep(5)
|
19 |
-
print("uth gya")
|
20 |
-
soup = BeautifulSoup(driver.page_source,'lxml')
|
21 |
-
headings = soup.find_all( name= 'span')
|
22 |
-
for heading in headings:
|
23 |
-
print(heading.getText())
|
24 |
-
print("fir sounga")
|
25 |
-
time.sleep(2)
|
26 |
-
driver.quit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|