vxwong / spain-visa-monitor

西班牙签证位置监听(base英国)
128 stars 64 forks source link

一直要bot验证怎么搞 #19

Open qwweerdf opened 1 year ago

qwweerdf commented 1 year ago

一直要bot验证怎么搞 Xnip2023-01-09_03-50-52

siri-rouser commented 1 year ago

Same issue

nickninov commented 1 year ago

Try using undetected_chromedriver - it worked on my side.

Example code:

import urllib3
import undetected_chromedriver as uc
from selenium import webdriver
from selenium.webdriver.chrome.service import Service

class Scraper():

    def __new__(self):

        options = webdriver.ChromeOptions()

        options.headless = False

        options.add_experimental_option("prefs", prefs)
        driver = uc.Chrome(options=options)        
        driver.implicitly_wait(10)

        return driver
ZyDing87 commented 1 year ago

May I ask which place did you use "Service"? Thank you . from selenium.webdriver.chrome.service import Service

nickninov commented 1 year ago

Thanks for the reply @ZyDing87. That line is redundant . I used it when I was using the default Chrome selenium browser. Here is the up to date version of my scraper:

import urllib3
import undetected_chromedriver as uc
from selenium.webdriver.chrome.options import Options

class Scraper():

    def __new__(self):

        options = Options()

        options.headless = False
        # Disables save password pop up in Google Chrome
        options.add_argument('--password-store=basic')
        # Adding argument to disable the AutomationControlled flag 
        options.add_argument("--disable-blink-features=AutomationControlled")

        driver = uc.Chrome(options=options)        
        driver.implicitly_wait(10)

        # Changing the property of the navigator value for webdriver to undefined 
        driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})") 

        return driver
ZyDing87 commented 1 year ago

Many thanks for the reply. That helps me a lot. I still got this issue " Robot verification failed, please try again." Do I need to install some extension software like noCatptcha?

nickninov commented 1 year ago

@ZyDing87 send a screenshot with more context. Not sure where you get this message from.

ZyDing87 commented 1 year ago

image

nickninov commented 1 year ago

Seems like this is coming directly from the website. I haven't seen this pop up on the French Visa application. In my case the user has already made an account and the bot just has to log in with the credentials.

Hope this is helpful: https://www.zenrows.com/blog/stealth-web-scraping-in-python-avoid-blocking-like-a-ninja

QZ-cmd commented 1 year ago

image

Hello, I also encountered this problem, how did you solve it, thank you very much

siri-rouser commented 1 year ago

Hi mate, I do not solve this problem yet, but I think someone already solved this, they build the API between his program and telegram which shows as a telegram group that noticing the slot every minute. If you try to search for this kind of group on Chinese social media xiaohongshu?

Hope this can be helpful

On Mon, Apr 17, 2023 at 11:49 QZ-cmd @.***> wrote:

[image: image] https://user-images.githubusercontent.com/48247835/226925558-cf9fb81b-439b-45c4-a48b-fde6e8fc4dbe.png

Hello, I also encountered this problem, how did you solve it, thank you very much

— Reply to this email directly, view it on GitHub https://github.com/vxwong/spain-visa-monitor/issues/19#issuecomment-1511034754, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOYB5M74WFD554MEM7QP4HTXBUG2DANCNFSM6AAAAAATU7IZQU . You are receiving this because you commented.Message ID: @.***>