Guest User

Untitled

a guest
Jun 20th, 2021
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. from selenium import webdriver
  2. import selenium
  3. import time
  4.  
  5. driver = webdriver.Chrome('/home/bogdan/Загрузки/chromedriver_linux64/chromedriver')
  6.  
  7. driver.get('https://parimatch.com/ru/table-tennis')
  8. time.sleep(4)
  9.  
  10. block = driver.find_elements_by_class_name('_2c98cYcZ15eCL3kXBibIh_')[:1]
  11. for item in block:
  12.     name = item.find_element_by_class_name('_26B_f8qfrQUqtdUjGVw3dk').text
  13.     time = item.find_element_by_class_name('_1LmvJKRD8MAsF3wKlXcsgF').text[9:]
  14.     p1 = item.find_element_by_class_name('_3Sa1tkZVXvesvtPRE_cUEV').text
  15.     p2w = item.find_elements_by_class_name('_3Sa1tkZVXvesvtPRE_cUEV')[1:]
  16.     for i in p2w:
  17.         p2 = i.text
  18.  
  19.         info = []
  20.         if float(p1) > 1.83 and float(p1) < 1.90:
  21.             if float(p2) > 1.83 and float(p2) < 1.90:
  22.                 result = {"times": time, "name": name, "p1": p1, "p2": p2, }
  23.                 info.append(result)
  24.  
  25.         prev_post = info
  26.         while True:
  27.             last_post = info
  28.             if prev_post != last_post:
  29.                     print(info)
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
Add Comment
Please, Sign In to add comment