0

I would click a button with requests library. I know that this is not possible, but I have tried to execute the function in Python. So: This is the HTML button code:

<a href="#" style="color:blue; font-size:32px; font-weight:bold;display:inline-block;" onclick="closeOverlay()">Continue to your image</a>

This is the function code:

function closeOverlay(){
    //hide chaturbate
    setCookie("overlay","true",1,"/","imagetwist.com");
    document.getElementById("rang2").style.display = "none";
    $('#rang2').children('iframe').remove();
}

And this is my Python code:

import requests
import time
from bs4 import BeautifulSoup
proxies={"http":"http://3.84.27.209:8080"}
url="https://imagetwist.com/99rhhpzjx6bq/server-iconns.png"
page=requests.get(url,proxies=proxies)
requestsJar=requests.cookies.RequestsCookieJar()
requestsJar.set("overlay","true",path="/",domain="imagetwist.com")
page=requests.get("https://imagetwist.com/99rhhpzjx6bq/server-iconns.png#",proxies=proxies,cookies=requestsJar)
print(page.text)

But it doesn't work, what is missing? I realize that it doesn't work because the views don't increase (I'm trying to bypass a check) Sorry for my bad english!

RMPR
  • 3,368
  • 4
  • 19
  • 31

2 Answers2

0

You cannot simulate clicks with requests lib ,use selenium for that .Preferably in headless mode .

0

I would suggest making something more simple than that. Do not focus entirely on only the requests and the proxy stuff.

georgekrax
  • 1,065
  • 1
  • 11
  • 22