-
Notifications
You must be signed in to change notification settings - Fork 0
/
tst1.py
41 lines (33 loc) · 1023 Bytes
/
tst1.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
31
32
33
34
35
36
37
38
39
40
41
import sys
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
import time
# saving file metter
file_name = 'ss1.html'
# get perametter from console
keywordName=sys.argv[1]
#keywordName='youtube'
options = webdriver.ChromeOptions()
#remove chorme popup window
#options.add_argument("--headless")
#start web browser
browser=webdriver.Chrome(options=options)
# get source code
browser.get("https://www.semrush.com/analytics/keywordoverview/?q="+keywordName+"&db=us")
#browser.find_elements_by_class_name("sso-tabs__el")[1].click()
browser.close()
print("Complete")
sys.exit()
print("Sys")
#------------------- Test codes
# # importing the library
# from bs4 import BeautifulSoup
# # Initializing variable
# gfg = BeautifulSoup(html)
# # Calculating result
# res = gfg.get_text()
# Printing the result
#print(res)