-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathloadMore.py
30 lines (22 loc) · 852 Bytes
/
loadMore.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import DirectoryVariable
import Constants
from selenium import webdriver
import chromedriver_autoinstaller
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from bs4 import BeautifulSoup
import time
def GetMoreStartups():
chromedriver_autoinstaller.install()
driver = webdriver.Chrome(service=Service())
driver.get(Constants.url);
time.sleep(DirectoryVariable.sleepDuration)
# Using BeautifulSoup using Selenuim
html = driver.page_source.encode('utf-8').strip()
document = BeautifulSoup(html , "html.parser");
# print(document.find(class_ = 'loadmore'))
(driver.find_element(By.CLASS_NAME , 'loadmore').click())
time.sleep(DirectoryVariable.sleepDuration)
document = driver.page_source.encode('utf-8').strip()
driver.quit();
return document;