Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
Add project
Browse files Browse the repository at this point in the history
  • Loading branch information
kkamara committed Aug 11, 2023
1 parent 38738e3 commit 7077217
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CORS_ALLOWED_ORIGINS='http://localhost'
TIME_ZONE='Europe/London'
APP_ENV=development
SIGNING_KEY=2de5c7b55db0e2bcbaac7a135e7b0cf340da8dba93f8c6d4f5ef0934887c834b
MARIADB_DATABASE=python_selenium
MARIADB_DATABASE=email_jobs_response_apply
MARIADB_USER=root
MARIADB_PASSWORD=
MARIADB_HOST=localhost
Expand Down
2 changes: 1 addition & 1 deletion .env.testing
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CORS_ALLOWED_ORIGINS='http://localhost'
TIME_ZONE='Europe/London'
APP_ENV=testing
SIGNING_KEY=2de5c7b55db0e2bcbaac7a135e7b0cf340da8dba93f8c6d4f5ef0934887c834b
MARIADB_DATABASE=python_selenium
MARIADB_DATABASE=email_jobs_response_apply
MARIADB_USER=root
MARIADB_PASSWORD=
MARIADB_HOST=localhost
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: 'secret'
MYSQL_DATABASE: 'python_selenium'
MYSQL_DATABASE: 'email_jobs_response_apply'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'secret'
ports:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"python.analysis.extraPaths": [
"${env:HOME}/workspace/python-selenium/.venv/bin"
"${env:HOME}/workspace/email-jobs-response-apply/.venv/bin"
]
}
31 changes: 21 additions & 10 deletions seleniumpy/management/commands/crawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,34 @@ def handle(self, *args, **options):
chrome_options.add_argument('--disable-dev-shm-usage')
browser = webdriver.Chrome(options=chrome_options)

browser.get('https://www.kelvinkamara.com')
browser.get('https://mail.google.com/mail/u/0/#search/label%3Aunread+newer%3A08-11-2023/FMfcgzGtwWMNnXpvcBBmMCKfbqLDVXWS')

self.screenshot(browser, name='debug')
el = browser.find_element(
By.XPATH, "//input[@id='identifierId']")

el.send_keys('kamaracomputers@gmail.com'+Keys.ENTER)

if 'Thisisnotinpagesource.' in browser.page_source:
raise RuntimeError('We were detected.')
del el
time.sleep(1)

browser.find_element(
By.XPATH, "//a[@id='contact-me-link']").click()
By.XPATH, "//input[@id='password']").send_keys(
''+Keys.ENTER)

el = browser.find_element(
By.XPATH, "//a[@href='tel:+447956694595'][2]")
self.screenshot(browser, el=el, name='number')
el.click()
# "//input[@id='phoneNumber']"

time.sleep(60)
self.screenshot(browser, name='debug')
# if 'Thisisnotinpagesource.' in browser.page_source:
# raise RuntimeError('We were detected.')
# time.sleep(1)

# el = browser.find_element(
# By.XPATH, "//a[@href='tel:+447956694595'][2]")
# self.screenshot(browser, el=el, name='number')
# el.click()

time.sleep(1)
# time.sleep(1)

browser.quit()
self.stdout.write(self.style.SUCCESS('Success'))
Expand Down

0 comments on commit 7077217

Please sign in to comment.