Commit cbfb130f authored by Your Name's avatar Your Name
Browse files

Selenium Linkedin module need improvement

parent faa0ca9b
This diff is collapsed.
......@@ -31,10 +31,6 @@ Waiting for: /html/body/div[7]/div[3]/div/div[2]/div/div[2]/main/div[1]/section/
Waiting for: /html/body/div[7]/div[3]/div/div[2]/div/div[2]/main/div[1]/section/div/div[2]/div[1]/div[2]/div/a[2]/span
Waiting for: /html/body/div[7]/div[3]/div/div[2]/div/div[2]/main/div[1]/section/div/div[2]/div[1]/div[2]/div/a[2]/span
Waiting for: /html/body/div[7]/div[3]/div/div[2]/div/div[2]/main/div[1]/section/div/div[2]/div[1]/div[2]/div/a[2]/span
Waiting for: /html/body/div[7]/div[3]/div/div[2]/div/div[2]/main/div[1]/section/div/div[2]/div[1]/div[2]/div/a[2]/span
Waiting for: /html/body/div[7]/div[3]/div/div[2]/div/div[2]/main/div[1]/section/div/div[2]/div[1]/div[2]/div/a[2]/span
Waiting for: /html/body/div[7]/div[3]/div/div[2]/div/div[2]/main/div[1]/section/div/div[2]/div[1]/div[2]/div/a[2]/span
Waiting for: /html/body/div[7]/div[3]/div/div[2]/div/div[2]/main/div[1]/section/div/div[2]/div[1]/div[2]/div/a[2]/span
found
==============================
lionel carra
......@@ -190,126 +186,3 @@ b'TGF1cmVudCBST1VTU0VM'
==============================
Christophe Leroy
b'Q2hyaXN0b3BoZSBMZXJveQ=='
{'https://www.linkedin.com/in/lionel-carra-638086142': b'bGlvbmVsIGNhcnJh', 'https://www.linkedin.com/in/ACoAAB5a9GoBNBe6DTG95dKnyGY5rYqFTyjSWME': b'TmF0aGFuIEJlcmNoZQ==', 'https://www.linkedin.com/in/ACoAACbDMowBMZ4JHtOPu7IZC0CzaV7nX6NVMLI': b'QXNzYW5hdG91IEJB', 'https://www.linkedin.com/in/jean-philippe-cou%C3%ABspel-du-mesnil-6ab1333': b'SmVhbi1QaGlsaXBwZSBDb3XDq3NwZWwgZHUgTWVzbmls', 'https://www.linkedin.com/in/ACoAAABAEaQBqxcwkC_pcNdu0m-xfJemnGgvkcg': b'RXJpYyBHbGFjZQ==', 'https://www.linkedin.com/in/ACoAAAFXceYBmmq2oIDmuOpIgqKISwffCjiZYpw': b'Q2hyaXN0b3BoZSBDRVJG', 'https://www.linkedin.com/in/roland-mor-3a255b': b'Um9sYW5kIE1vcg==', 'https://www.linkedin.com/in/ACoAAACbwiABTUrScfxmnSFYE_zqJdUmtqfPI30': b'S0FaQVIgWWFzc2ly', 'https://www.linkedin.com/in/neige-sanchez-91179a24': b'TmVpZ2UgU0FOQ0hFWg==', 'https://www.linkedin.com/in/bertrand-quill%C3%A9v%C3%A9r%C3%A9-64822b4': b'QmVydHJhbmQgUXVpbGzDqXbDqXLDqQ==', 'https://www.linkedin.com/in/ACoAABQXpMsBMagfdjczcNHph24ym_KA7g3NXdY': b'TWlndWVsIFJPTUU=', 'https://www.linkedin.com/in/yannick-cess-8b888311a': b'WWFubmljayBDZXNz', 'https://www.linkedin.com/in/ACoAAAJcYjIBDQMMhxdQTCGEljzjtcwyCdMGOT4': b'VGVvZG9yIENoYWJpbg==', 'https://www.linkedin.com/in/ACoAAB6L63kBhn4k8EEk_2zdn97M6bxvKl9qq6I': b'UmloYWIgQmVudHRhaWJp', 'https://www.linkedin.com/in/amandinecara': b'QW1hbmRpbmUgQ2FyYQ==', 'https://www.linkedin.com/in/berengerelabeaute': b'QmVyZW5nZXJlIExBQkVBVVRF', 'https://www.linkedin.com/in/ACoAAAUedToBXZypiYxl0An83hBF2CESqSDkxJE': b'Q2zDqW1lbnQgRmF2aWVy', 'https://www.linkedin.com/in/ACoAAAt20TgBk-UaAdUgaDyMm_VQc4c4zRLuJbs': b'TGF1cmVudCBWZXJuaXF1ZQ==', 'https://www.linkedin.com/in/eric-schirmann-478560': b'RXJpYyBTY2hpcm1hbm4=', 'https://www.linkedin.com/in/fiona-pougeaud': b'RmlvbmEgUE9VR0VBVUQ=', 'https://www.linkedin.com/in/didier-buzin-86682584': b'RGlkaWVyIEJ1emlu', 'https://www.linkedin.com/in/ACoAAAZs7SYBNFo9RaUgSmhKBvO0HUNEF6Jf-lw': b'RW1pbGllbiBQSUVURVJT', 'https://www.linkedin.com/in/cristina-d%C3%ADez-54986360': b'Q3Jpc3RpbmEgRMOtZXo=', 'https://www.linkedin.com/in/nicolas-llorca-isr-manager': b'Tmljb2xhcyBMTE9SQ0E=', 'https://www.linkedin.com/in/ACoAAAB-ElwBq-cin2q03rqN6I4f5kU9pYm6HQs': b'RnJlZGVyaWMgR09VVEg=', 'https://www.linkedin.com/in/ACoAAAC3S4YB64mN2BOBqBwOrXEArbnb4DEu9is': b'T2xpdmllciBHbGV5emU=', 'https://www.linkedin.com/in/fefenkono': b'RmVybmFuZGEgTmtvbm8gTnlhbmdvbm8=', 'https://www.linkedin.com/in/oussama-benkraiem-87b968137': b'b3Vzc2FtYSBiZW5rcmFpZW0=', 'https://www.linkedin.com/in/ACoAAA0s8VMBuxzTTMX2ABFw7gBj4FxXbhZO1GQ': b'U2FsYWhlZGRpbmUgSmVyYmk=', 'https://www.linkedin.com/in/ACoAABJSAe4BWy7aJTQZ1oJCH3hGjEfAwhzS1yg': b'QWJkZWxhbGkgR09VSURFUg==', 'https://www.linkedin.com/in/laurent-vernique-7b44b554': b'TGF1cmVudCBWZXJuaXF1ZQ==', 'https://www.linkedin.com/in/ACoAAAAY8xQBiJ4QKAyExsFEjYRR0ANZsBfsrRs': b'TGF1cmVudCBST1VTU0VM', 'https://www.linkedin.com/in/de-framond-cybersecurity': b'SnVsaWVuIGRlIEZyYW1vbmQ=', 'https://www.linkedin.com/in/ba-assanatou': b'QXNzYW5hdG91IEJB', 'https://www.linkedin.com/in/ACoAAAF-l4sB6XnGdhKBx96CDbtIGzdTWllDS1k': b'Q2hyaXN0b3BoZSBMZXJveQ=='}
Getting details of: https://www.linkedin.com/in/lionel-carra-638086142
linkedin.com/in/lionel-carra-638086142
Getting details of: https://www.linkedin.com/in/ACoAAB5a9GoBNBe6DTG95dKnyGY5rYqFTyjSWME
linkedin.com/in/nathan-berche-7a2680122
berchenathan15@gmail.com
Getting details of: https://www.linkedin.com/in/ACoAACbDMowBMZ4JHtOPu7IZC0CzaV7nX6NVMLI
linkedin.com/in/ba-assanatou
aba@quodagis.fr
Getting details of: https://www.linkedin.com/in/jean-philippe-cou%C3%ABspel-du-mesnil-6ab1333
linkedin.com/in/jean-philippe-couëspel-du-mesnil-6ab1333
Getting details of: https://www.linkedin.com/in/ACoAAABAEaQBqxcwkC_pcNdu0m-xfJemnGgvkcg
linkedin.com/in/ericglace
eric.glace@gmail.com
Getting details of: https://www.linkedin.com/in/ACoAAAFXceYBmmq2oIDmuOpIgqKISwffCjiZYpw
linkedin.com/in/cerfconseilprev
conseilprevup.com/
Paris 75014
christophe.cerf@conseilprev.com
conseilprev1
conseilprevren1
Getting details of: https://www.linkedin.com/in/roland-mor-3a255b
linkedin.com/in/roland-mor-3a255b
Getting details of: https://www.linkedin.com/in/ACoAAACbwiABTUrScfxmnSFYE_zqJdUmtqfPI30
linkedin.com/in/yassirkazar
y.kazar@yogosha.com
Getting details of: https://www.linkedin.com/in/neige-sanchez-91179a24
linkedin.com/in/neige-sanchez-91179a24
vialis-it.com
Getting details of: https://www.linkedin.com/in/bertrand-quill%C3%A9v%C3%A9r%C3%A9-64822b4
linkedin.com/in/bertrand-quillévéré-64822b4
vialis-it.com
Getting details of: https://www.linkedin.com/in/ACoAABQXpMsBMagfdjczcNHph24ym_KA7g3NXdY
linkedin.com/in/miguel-rome-54ba8594
romemiguel@me.com
RomeRomemiguel
Getting details of: https://www.linkedin.com/in/yannick-cess-8b888311a
linkedin.com/in/yannick-cess-8b888311a
Getting details of: https://www.linkedin.com/in/ACoAAAJcYjIBDQMMhxdQTCGEljzjtcwyCdMGOT4
linkedin.com/in/teodorchabin
cyberlead.io
teodor.chabin@gmail.com
teodorcbn
Getting details of: https://www.linkedin.com/in/ACoAAB6L63kBhn4k8EEk_2zdn97M6bxvKl9qq6I
linkedin.com/in/rihab-benttaibi-849769123
rihab.benttaibi@gmail.com
Getting details of: https://www.linkedin.com/in/amandinecara
linkedin.com/in/amandinecara
AmandineCara
Getting details of: https://www.linkedin.com/in/berengerelabeaute
linkedin.com/in/berengerelabeaute
quodagis.com
it-tude.fr
eodesk.fr
blabeaute
Getting details of: https://www.linkedin.com/in/ACoAAAUedToBXZypiYxl0An83hBF2CESqSDkxJE
linkedin.com/in/clément-favier-3b691824
cfavier@gmail.com
Getting details of: https://www.linkedin.com/in/ACoAAAt20TgBk-UaAdUgaDyMm_VQc4c4zRLuJbs
linkedin.com/in/laurent-vernique-7b44b554
laurent.vernique@gmail.com
Getting details of: https://www.linkedin.com/in/eric-schirmann-478560
linkedin.com/in/eric-schirmann-478560
it-tude.fr
numara.fr
attitude-it.com
EricSchirmann
Getting details of: https://www.linkedin.com/in/fiona-pougeaud
linkedin.com/in/fiona-pougeaud
Getting details of: https://www.linkedin.com/in/didier-buzin-86682584
linkedin.com/in/didier-buzin-86682584
didier.buzin@outlook.com
Getting details of: https://www.linkedin.com/in/ACoAAAZs7SYBNFo9RaUgSmhKBvO0HUNEF6Jf-lw
linkedin.com/in/emilien-pieters
emilien.pieters@gmail.com
Getting details of: https://www.linkedin.com/in/cristina-d%C3%ADez-54986360
linkedin.com/in/cristina-díez-54986360
Getting details of: https://www.linkedin.com/in/nicolas-llorca-isr-manager
linkedin.com/in/nicolas-llorca-isr-manager
quodagis.fr/
nicolas.llorca.nl@gmail.com
Getting details of: https://www.linkedin.com/in/ACoAAAB-ElwBq-cin2q03rqN6I4f5kU9pYm6HQs
linkedin.com/in/gouth
fredericgouth.com/
gouth.fr
clusir-aquitaine.fr/
fgouth@gouth.fr
FredGOUTH
Getting details of: https://www.linkedin.com/in/ACoAAAC3S4YB64mN2BOBqBwOrXEArbnb4DEu9is
linkedin.com/in/oliviergleyze
o.gleyze@gmail.com
TitouTwitR
Getting details of: https://www.linkedin.com/in/fefenkono
linkedin.com/in/fefenkono
Getting details of: https://www.linkedin.com/in/oussama-benkraiem-87b968137
linkedin.com/in/oussama-benkraiem-87b968137
Getting details of: https://www.linkedin.com/in/ACoAAA0s8VMBuxzTTMX2ABFw7gBj4FxXbhZO1GQ
linkedin.com/in/salaheddine-jerbi-b8304162
jerbisalaheddine@gmail.com
Getting details of: https://www.linkedin.com/in/ACoAABJSAe4BWy7aJTQZ1oJCH3hGjEfAwhzS1yg
linkedin.com/in/abdelali-gouider-a66b2886
6 Rue Khawarezmi cité Firdaous Laouina
abdelali.guider@gmail.com
Getting details of: https://www.linkedin.com/in/laurent-vernique-7b44b554
linkedin.com/in/laurent-vernique-7b44b554
laurent.vernique@gmail.com
Getting details of: https://www.linkedin.com/in/ACoAAAAY8xQBiJ4QKAyExsFEjYRR0ANZsBfsrRs
linkedin.com/in/laurentroussel
it-tude.fr
lroussel@it-tude.fr
laurent_roussel
Getting details of: https://www.linkedin.com/in/de-framond-cybersecurity
linkedin.com/in/de-framond-cybersecurity
agsyndro.me
j.deframond_pro@protonmail.com
Getting details of: https://www.linkedin.com/in/ba-assanatou
linkedin.com/in/ba-assanatou
aba@quodagis.fr
Getting details of: https://www.linkedin.com/in/ACoAAAF-l4sB6XnGdhKBx96CDbtIGzdTWllDS1k
linkedin.com/in/christophe-leroy-1a34928
Ile de France
chris.lry@free.fr
......@@ -37,21 +37,26 @@ proxy = Proxy({
username_linkedin = "j.deframond_pro@protonmail.com"
password_linkedin = "JaAwAaqh5hb5jMW"
def wait_element_by_xpath(xpath):
def wait_element_by_xpath(browser, xpath):
print("Waiting for: " + xpath)
is_element_available = False
counter = 60
while not is_element_available:
try:
search = browser.find_element_by_xpath(xpath)
search = browser.wait_element_by_xpath(browser, xpath)
is_bar_search_available =True
print("found")
return search
except:
print("Waiting for: " + xpath)
counter -= 1
is_bar_search_available = False
if not counter:
print("Reloading")
browser.get(browser.current_url)
counter=60
time.sleep(1)
def make_a_linkedin_request(browser, query):
is_bar_search_available = False
while not is_bar_search_available:
......@@ -79,7 +84,7 @@ def login_to_linkedin(browser, username_linkedin, password_linkedin):
def extract_employee_from_enterprise(browser, url_linkedin):
dictionary_users={}
browser.get(url_linkedin)
search = wait_element_by_xpath('/html/body/div[7]/div[3]/div/div[2]/div/div[2]/main/div[1]/section/div/div[2]/div[1]/div[2]/div/a[2]/span')
search = wait_element_by_xpath(browser, '/html/body/div[7]/div[3]/div/div[2]/div/div[2]/main/div[1]/section/div/div[2]/div[1]/div[2]/div/a[2]/span')
search.click()
time.sleep(2)
# Max page number to review
......@@ -90,7 +95,7 @@ def extract_employee_from_enterprise(browser, url_linkedin):
browser.execute_script("window.scrollTo(0, document.body.scrollHeight);")
links = browser.find_elements_by_xpath("//a[@href]")
for l in links:
if l.get_attribute("className") == "app-aware-link" and not "en commun" in l.get_attribute("innerText") and l.get_attribute("innerText") and "https://www.linkedin.com/in" in l.get_attribute('href'):
if l.get_attribute("className") == "app-aware-link" and not "en commun" in l.get_attribute("innerText") and l.get_attribute("innerText") and "https://www.linkedin.com/in" in l.get_attribute('href'):
name_user = l.get_attribute("innerText").split('\n')[0]
link_user = l.get_attribute("href")
print("==============================")
......@@ -142,7 +147,9 @@ def get_contact_details(browser, url):
b.click()
except:
pass
print("Getting details of: " + url)
full_name = browser.wait_element_by_xpath(browser, '/html/body/div[5]/div[3]/div/div/div/div/div[3]/div/div/main/div/section/div[2]/div[2]/div[1]/div[1]/h1').innerText
print("Getting details of: " + full_name)
print(url)
list_ressources = browser.find_elements_by_class_name("pv-contact-info")
for r in list_ressources:
time.sleep(1)
......@@ -151,6 +158,8 @@ def get_contact_details(browser, url):
print(url.text)
except:
pass
print("=====================================")
# get_contact_details(browser=browser, url='https://www.linkedin.com/in/ba-assanatou/')
if __name__ == "__main__":
......@@ -161,9 +170,12 @@ if __name__ == "__main__":
login_to_linkedin(browser=browser, username_linkedin=username_linkedin, password_linkedin=password_linkedin)
#make_a_linkedin_request(browser=browser,query="quodagis")
users_dict = {}
users_dict = extract_employee_from_enterprise(browser=browser, url_linkedin='https://www.linkedin.com/company/quodagis/people/')
users_dict = extract_employee_from_enterprise(browser=browser, url_linkedin='https://www.linkedin.com/company/quodagis/')
print(users_dict)
for url in users_dict:
for url in users_dict:
get_contact_details(browser=browser, url=url)
browser.quit()
# Get the name of the person
#/html/body/div[5]/div[3]/div/div/div/div/div[3]/div/div/main/div/section/div[2]/div[2]/div[1]/div[1]/h1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment