-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
45 lines (37 loc) · 1.4 KB
/
app.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
42
43
44
import pandas as pd
import re
import itertools
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
import os
from dotenv import load_dotenv
# form seleniumbase import seleniumbase
load_dotenv()
def launchBrowser():
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
driver.get("https://www.linkedin.com/")
return driver
browser = launchBrowser()
LINKEDIN_PASSWORD = os.getenv('LINKEDIN_PASSWORD')
username = browser.find_element(By.ID, "session_key")
password = browser.find_element(By.ID, "session_password")
username.send_keys("mohitkumar11725@gmail.com")
password.send_keys(LINKEDIN_PASSWORD)
login = browser.find_element(By.CLASS_NAME, "sign-in-form__submit-button")
login.click()
browser.get("https://www.linkedin.com/jobs/")
job_title=browser.find_element(By.CLASS_NAME, "job-card-list__title")
# company= browser.find_element(By.XPATH, "//span[@class='job-card-container__primary-description']//following-sibling::a")
# location=browser.find_element(By.CLASS_NAME, "job-card-container__metadata-item")
# job_links=browser.find_element(By.CLASS_NAME, "job-card-container__link")
c=[]
print(job_title)
for i in job_title:
print(i.text)
# c.append(i.text)
# c.append(i.text.get_attribute("href"))
# print(c,"\n")
# print()
# print(len(c))