求助爬虫大佬

查看 40|回复 2
作者:stuazt   
https://www.visa.com.sg/cmsapi/fx/rates?amount=100&fee=0&utcConvertedDate=06/02/2023&exchangedate=06/02/2023&fromCurr=CNY&toCurr=USD
想从visa网站爬汇率,上面这个url,一访问就给脸色看,返回的部分内容:
[ol]Sorry, you have been blocked
        You are unable to access visa.com.sg
This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.
          What can I do to resolve this?
            You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.
          Cloudflare Ray ID: 7d1030877eac3f87
    •
   
      Your IP:
      Click to reveal
      20.212.226.221
      •
   
    Performance & security by Cloudflare[/ol]复制代码
原始页面是: https://www.visa.com.sg/support/consumer/travel-support/exchange-rate-calculator.html
试过了,不是因为ip,因为第一个url随便打开一个浏览器直接访问就能返回json;根本不需要访问原始页面也可以。Chrome隐私模式也都没问题。
用的selenium+chromedriver, headless模式

大佬, 模式, 页面

ttyang   
curl也不行
说明需要header等信息,
不能让网站识别出来你是selenium
伪装一下吧
Tankie   
去试下stealth.min.js,我用这个通过不少检测,再高级的我也不会
您需要登录后才可以回帖 登录 | 立即注册

返回顶部