Answer the question
In order to leave comments, you need to log in
I want to parse phone numbers from OLX.ua, but nothing comes out, it says “suspicious activity detected”, what can I do?
I want to parse phone numbers from OLX.ua, but it doesn’t work, it says “suspicious activity detected”, I use a proxy, I tried a huge list of proxies I have, the page loads, as soon as I start following links, this window appears:
What can I do, to solve this problem?
The code
from selenium import webdriver
import time
import random
urls = open("input.txt", "r")
for url in urls:
myProxy = random.choice(open('proxy.txt').readlines())
print(myProxy + "\n")
def get_url(driver):
driver.get(url)
print("GOT URL")
time.sleep(3)
def press_cookie_btn(driver):
cookie_btn = driver.find_element_by_xpath("//div[@class='topinfo rel']"
"/button[@class='cookie-close abs cookiesBarClose']")
cookie_btn.click()
print("COOKIE")
time.sleep(2)
def page_pagination(driver):
ars = driver.find_elements_by_xpath("//a[@class='marginright5 link linkWithHash detailsLink']")
urls_1 = []
for ar in ars:
url_1 = ar.get_attribute("href")
urls_1.append(url_1)
print(url_1)
for url_2 in urls_1:
driver.get(url_2)
time.sleep(3)
driver.get(url)
time.sleep(3)
def main():
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--proxy-server=%s' % myProxy)
driver = webdriver.Chrome(options=chrome_options)
driver.implicitly_wait(10)
get_url(driver)
press_cookie_btn(driver)
page_pagination(driver)
driver.quit()
main()
urls.close()
Answer the question
In order to leave comments, you need to log in
kopelev2000 , try to randomize pauses on pages and in general everything that is possible.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question