English 中文(简体)
在当地进行拆卸时,网络查询是成功的,但在制作过程中发现我是机器人。
原标题:When running scraping (puppeteer) locally the web queries are successful, but in production it detects me as a robot

I am trying to scrape a web page that has a reCaptcha v2, the resolution of the reCaptcha locally (windows 10 and chrome PC) is done correctly, but when I run it in production on a CentOS 7 server and when I click on the reCaptcha box I get the message:

Your computer or network may be sending automated queries To protect our users, we can t process your request right now For more detaile vigit pur_heWppge.

我还在GCP创建了一个有Utub 20的计算厂,也发生了同样的事情(甚至使用Xvfb = 无头:假)。

什么其他组合可以适用于pet子?

browser = await puppeteer.launch({
    args: ["--no-sandbox", "--disable-setuid-sandbox",
           "--disable-blinkfeatures=AutomationControlled",
           "--no-first-run", "--no-proxy-server"],
     //headless: false
     headless:  new 
    }); 
   
let page = await browser.newPage();
await page.setUserAgent( Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,  like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0 );
   
   
const customHeaders = {
     Accept-Language :  es,es-ES;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6 ,
     Sec-Ch-Ua :  "Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120" ,
     Sec-Ch-UA-Platform :  "Windows" ,
     Sec-Fetch-Site :  same-origin ,
     User-Agent :  Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0 
   };
await page.setExtraHTTPHeaders(customHeaders);
await page.goto(url);

问题回答

如果在数据中心部署Centos服务器,你可以尝试使用住宅代理。 许多网站都把数据集束缚起来。





相关问题
Deploying WCF application

I have IIS-Hosted WCF application and services. I want to automate the process to deploy this application into test/Acceptance test/production environments What is the best way to automate the process ...

CGWindowID from AXUIElement

I m trying to automate a foreign OSX application using the accessibility API. Some of the state of the application isn t available through the API, so I acquire it through screen scraping. To do this, ...

Snapping pictures from Windows C# Canon SDK vs PTP or MTP

I am hoping to receive some general guidance on accomplishing a seemingly simple goal. I have a DSLR camera (Canon EOS 50D) and need to write an application that will tell the camera to take a ...

热门标签