How to write the query?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
There is a certain website which I need to send a request using the requests library.
How to pass these Heders
GET HTTP/1.1 Host: Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Referer: Accept-Encoding: gzip, deflate, br Accept-Language: ru-ru,ru;q=0.9,en-US;q=0.8,en;q=0.7 Cookie: _ga=GA1.2.1169963389.1523803584;; stel_ssid=31dffdd3cd3dca265d_2963das1217952533; _gid=GA1.2.1199944186.1524831182

There is such code:
import requests from fake_useragent import UserAgent url = 'https://юрлсайта.ком' r = requests.get(url, headers={'User-Agent': UserAgent().chrome}) print(r.text)
by | 7 views

1 Answer

0 like 0 dislike
import requests url = "" querystring = {"embed":"1%20HTTP/1.1"} headers = { 'Host': "" 'Connection': "keep-alive", 'Upgrade-Insecure-Requests': "1", 'User-Agent': "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", 'Referer': "", 'Accept-Encoding': "gzip, deflate, br", 'Accept-Language': "EN-us,EN;q=0.9,en-US;q=0.8,en;q=0.7", 'Cookie': "_ga=GA1.2.1169963389.1523803584;; stel_ssid=31dffdd3cd3dca265d_2963das1217952533; _gid=GA1.2.1199944186.1524831182", 'Cache-Control': "no-cache", 'Postman-Token': "930f1009-7e5f-436e-9b5f-da372e57ac8c" } response = requests.request("GET", url, headers=headers, params=querystring) print(response.text)

There is such a thing as a Postman , you can test the queries. one of the chips - code generation on different footing, including Python requests. do not suggest direct fiercely from there to take it, but to understand how and what can help.
110,608 questions
257,186 answers
35,431 users