sarperavci / CloudflareBypassForScraping

A cloudflare verification bypass script for webscraping
262 stars 39 forks source link

Needs to be updated #10

Open neoxedneox opened 1 week ago

neoxedneox commented 1 week ago

Hello,

It no longer bypass Cloudflare "Verify you are a human" page, I think they have updated the page today.

'xpath://div/iframe' is showing "None" when I try to get it's value.

sarperavci commented 1 week ago

Hello, I updated the repo and committed the changes: https://github.com/sarperavci/CloudflareBypassForScraping/commit/e592b98c2932e6dec66f3b68f9b79e57796b3dec. Please ensure that you have installed DrissionPage version 4.0.5.6:

pip3 install DrissionPage==4.0.5.6

In this DrissionPage version, I had to slightly modify test.py as well: https://github.com/sarperavci/CloudflareBypassForScraping/commit/e71a8b3e5c3cdae3c44e4982928736115d0cf487.

faske7 commented 1 week ago

hello, im install new version but have trouble button already click but Cloudflare not pass

Снимок экрана 2024-07-06 в 21 52 54
sarperavci commented 1 week ago

hello, im install new version but have trouble button already click but Cloudflare not pass Снимок экрана 2024-07-06 в 21 52 54

I just ran it and it works flawlessly. If you are using data center proxies, CF may recognize them and completely block the page from opening.

neoxedneox commented 1 week ago

Hello, I updated the repo and committed the changes: e592b98. Please ensure that you have installed DrissionPage version 4.0.5.6:

pip3 install DrissionPage==4.0.5.6

In this DrissionPage version, I had to slightly modify test.py as well: e71a8b3.

I've tested it and works fine now. Thank you

neoxedneox commented 1 week ago

hello, im install new version but have trouble button already click but Cloudflare not pass Снимок экрана 2024-07-06 в 21 52 54

Close DevTools if it's open, it could be the issue

SaberTawfiq commented 1 week ago

https://visa.vfsglobal.com/egy/en/hrv/login i test on this website and it's not work

frkncnblt01 commented 1 week ago

After yesterday midnight, it didnt work. Please comment me your tries. Did you pass the cloudflare ?

sarperavci commented 1 week ago

https://visa.vfsglobal.com/egy/en/hrv/login i test on this website and it's not work

It's a Cloudflare Captcha, not a CF 'Under Attack' page. Check the demo video

After yesterday midnight, it didnt work. Please comment me your tries. Did you pass the cloudflare ?

I just ran the latest test.py and it worked flawlessly. Please elaborate on your issue and share some terminal output. Ensure that you have updated DrissionPage as I mentioned here.

SaberTawfiq commented 1 week ago

https://visa.vfsglobal.com/egy/en/hrv/login i test on this website and it's not work

It's a Cloudflare Captcha, not a CF 'Under Attack' page. Check the demo video

After yesterday midnight, it didnt work. Please comment me your tries. Did you pass the cloudflare ?

I just ran the latest test.py and it worked flawlessly. Please elaborate on your issue and share some terminal output. Ensure that you have updated DrissionPage as I mentioned here.

it was working and click on the verify you are human in the CF 'Under Attack' and the Cloudflare Captcha, with this

if self.driver.wait.ele_displayed('xpath://div/iframe',timeout=1.5):
            time.sleep(1.5)
            self.driver('xpath://div/iframe').ele("Verify you are human", timeout=2.5).click()

Now the iframe not fond because they add the cloudflare code in shadow dom

Untitled how to handle this?

sarperavci commented 1 week ago

https://visa.vfsglobal.com/egy/en/hrv/login i test on this website and it's not work

It's a Cloudflare Captcha, not a CF 'Under Attack' page. Check the demo video

After yesterday midnight, it didnt work. Please comment me your tries. Did you pass the cloudflare ?

I just ran the latest test.py and it worked flawlessly. Please elaborate on your issue and share some terminal output. Ensure that you have updated DrissionPage as I mentioned here.

it was working and click on the verify you are human in the CF 'Under Attack' and the Cloudflare Captcha, with this

if self.driver.wait.ele_displayed('xpath://div/iframe',timeout=1.5):
            time.sleep(1.5)
            self.driver('xpath://div/iframe').ele("Verify you are human", timeout=2.5).click()

Now the iframe not fond because they add the cloudflare code in shadow dom

Untitled how to handle this?

Then modify the code as it follows from:

if self.driver.wait.ele_displayed('xpath://div/iframe',timeout=1.5):
            time.sleep(1.5)
            self.driver('xpath://div/iframe').ele("Verify you are human", timeout=2.5).click()

to

if self.driver.wait.ele_displayed('.cf-turnstile-wrapper',timeout=3.5):
            time.sleep(1.5)
            self.driver.ele(".cf-turnstile-wrapper", timeout=2.5).click()
SaberTawfiq commented 6 days ago

https://visa.vfsglobal.com/egy/en/hrv/login i test on this website and it's not work

It's a Cloudflare Captcha, not a CF 'Under Attack' page. Check the demo video

After yesterday midnight, it didnt work. Please comment me your tries. Did you pass the cloudflare ?

I just ran the latest test.py and it worked flawlessly. Please elaborate on your issue and share some terminal output. Ensure that you have updated DrissionPage as I mentioned here.

it was working and click on the verify you are human in the CF 'Under Attack' and the Cloudflare Captcha, with this

if self.driver.wait.ele_displayed('xpath://div/iframe',timeout=1.5):
            time.sleep(1.5)
            self.driver('xpath://div/iframe').ele("Verify you are human", timeout=2.5).click()

Now the iframe not fond because they add the cloudflare code in shadow dom Untitled how to handle this?

Then modify the code as it follows from:

if self.driver.wait.ele_displayed('xpath://div/iframe',timeout=1.5):
            time.sleep(1.5)
            self.driver('xpath://div/iframe').ele("Verify you are human", timeout=2.5).click()

to

if self.driver.wait.ele_displayed('.cf-turnstile-wrapper',timeout=3.5):
            time.sleep(1.5)
            self.driver.ele(".cf-turnstile-wrapper", timeout=2.5).click()

this ele open cf website in newtab

sarperavci commented 6 days ago

You can find the exact element with developer tools and replace the element selector on your code.

driver.ele(".fullclassname")
driver.ele("#id")
driver.ele("text")