Skip to content

Python script, which empowers people with no programming background to generate robust leads on a mass scale. This repo will be compiled of various versatile techniques used in lead generation.

find company by title implemented

Madi083c50923992
diff --git a/linkedin/extractor.py b/linkedin/extractor.py
index 7269e66..ddfa9fd 100644
--- a/linkedin/extractor.py
+++ b/linkedin/extractor.py
@@ -60,11 +60,28 @@ class LinkedIn(Webdriver):
sleep(uniform(2, 5))
async def search_title(self, title):
- await self._page.click(search_locator)
- sleep(uniform(2, 3))
- await self.type_(title)
- sleep(uniform(0.5, 1))
- await self._page.keyboard.press('Enter')
+ # await self._page.click(search_locator)
+ # sleep(uniform(2, 3))
+
+ # await self.type_(title)
+ # sleep(uniform(0.5, 1))
+
+ # await self._page.keyboard.press('Enter')
+ # sleep(uniform(2,5))
+
+ # select_bar = (await self._page.xpath(select_bar_xpath))[0]
+ # await select_bar.click()
+
+ await self._page.goto(f'https://www.linkedin.com/search/results/companies/?keywords={title}&origin=GLOBAL_SEARCH_HEADER')
+ companies = await self._page.querySelectorAll(companies_locator)
+
+ if not companies:
+ return 'Nothing Found'
+
+ await companies[0].click()
+
+ async def open_members(self):
+ pass
def break_title(self, title):
return
diff --git a/linkedin/locators.py b/linkedin/locators.py
index 0032bb8..d4f990f 100644
--- a/linkedin/locators.py
+++ b/linkedin/locators.py
@@ -1,4 +1,7 @@
login_locator = 'a.nav__button-secondary'
pwd_locator = 'input#password'
show_pwd_locator = 'span#password-visibility-toggle'
-search_locator = 'input.search-global-typeahead__input.always-show-placeholder'
\ No newline at end of file
+search_locator = 'input.search-global-typeahead__input.always-show-placeholder'
+companies_locator = '.entity-result__title-text a'
+
+select_bar_xpath = '//*[@d="M8 11L3 6h10z"]'
\ No newline at end of file