Studying Footprint Automation for Matching Apps (Python, Selenium, BeautifulSoup,)

#!/usr/bin/env python
# coding: utf-8

from selenium import webdriver
from import By
from import WebDriverWait
from import expected_conditions as EC
from bs4 import BeautifulSoup
from time import sleep

driver = webdriver.Chrome('chromedriver')

#Login automation
# driver.get('')
# id = driver.find_element_by_id("email")
# id.send_keys('')

# password = driver.find_element_by_id('pass')
# password.send_keys('')
# login_button = driver.find_element_by_id("loginbutton")
# login2 = driver.find_element_by_id('u_0_f')
# code = driver.find_element_by_id('approvals_code')
# val1 = input()
# code.send_keys(val1)
# nextlogin = driver.find_element_by_id('checkpointSubmitButton')


#Update at the bottom of the page
for i in range(10):
    driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
soup = BeautifulSoup(driver.page_source, 'html.parser')

#Get only the link
links = [url.get('href') for url in soup.find_all('a')]

#Extract only users from links
links = [s for s in links if "users" in s]

#Access as many as users
for link in links:
    href = '' + link



--Login automation is not smart --Infinite scrolling is not smart

Recommended Posts

Studying Footprint Automation for Matching Apps (Python, Selenium, BeautifulSoup,)
python selenium chromedriver beautifulsoup
[Python + Selenium] Tips for scraping
ElasticSearch + Kibana + Selenium + Python for SEO
Overwrite download file for python selenium Chrome
Studying python
Selenium + WebDriver (Chrome) + Python | Building environment for scraping
Instant method grammar for Python and Ruby (studying)