Advertisement
Danila_lipatov

parser_selenium

Jul 19th, 2024
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. import pandas as pd
  2. import os
  3. from bs4 import BeautifulSoup as bs
  4. import urllib.request
  5. import requests
  6. from selenium import webdriver
  7. from selenium.webdriver.chrome.service import Service
  8. from selenium.webdriver.chrome.options import Options
  9. from webdriver_manager.chrome import ChromeDriverManager
  10. from selenium.webdriver.common.by import By
  11. from selenium.webdriver.common.keys import Keys
  12.  
  13.  
  14.  
  15.  
  16.  
  17. # chrome_driver_path = '"C:\Program Files\Google\Chrome\Application\chrome.exe"'
  18.  
  19. driver = webdriver.Chrome(ChromeDriverManager().install())
  20.  
  21. if __name__ == '__main__':
  22.     df = pd.read_excel('test_example.xlsx')
  23.     ident = 'identifier'
  24.     ident_type = 'identifier_type'
  25.     count = 0
  26.     # browser = webdriver.Firefox()
  27.     driver.get(url)
  28.     for ind in df.index:
  29.         if df[ident][ind] != None or df[ident_type][ind] == 'ИНН':
  30.             elem = driver.find_element(By.CLASS_NAME, 'prr-form__item-input')
  31.             elem.send_keys(df[ident][ind] + Keys.RETURN)
  32.             stop = 0
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement