Skip to content
rglszl edited this page Feb 17, 2020 · 1 revision

Welcome to the curlToRequests wiki!

Usage:

  1. Copy a bash curl command from Google Chrome developer tools
  2. Call the script like this: python ./curlToRequests.py """curl 'https://www.google.com/search?source=hp&ei=ZH1KXp7-ONG1kwXRl4uQCg&q=github&oq=github&gs_l=psy-ab.3..0l10.7637.8612..13094...0.0..0.113.691.2j5......0....1..gws-wiz.....0.0Eg5l_5bUCY&ved=0ahUKEwiewPX-wdjnAhXR2qQKHdHLAqIQ4dUDCAY&uact=5' -H 'authority: www.google.com' -H 'pragma: no-cache' -H 'cache-control: no-cache' -H 'upgrade-insecure-requests: 1' -H 'dnt: 1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36' -H 'sec-fetch-user: ?1' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9' -H 'sec-fetch-site: same-origin' -H 'sec-fetch-mode: navigate' -H 'referer: https://www.google.com/' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-US,en;q=0.9,hu;q=0.8,es;q=0.7' -H 'cookie: NID=198=kCV01caKwLRWW7DwscdMBx3ghFYxwazNyYlBgcwvVcd6NbUxeDgpsfy5bksxQ3Bs4gLyW7zr-covdTENsNTdjnAcxoaiKz7gEuDOIXcu6Bax_c2RrUiY2uyBRCV9gdXt37jpJ0LzEo-cSUpBHmqkUP3LH_KLQjKAsfIhLfT9QGo; CONSENT=WP.283b16; 1P_JAR=2020-02-17-11' --compressed"""

The output will be:

url="https://www.google.com/search?source=hp&ei=ZH1KXp7-ONG1kwXRl4uQCg&q=github&oq=github&gs_l=psy-ab.3..0l10.7637.8612..13094...0.0..0.113.691.2j5......0....1..gws-wiz.....0.0Eg5l_5bUCY&ved=0ahUKEwiewPX-wdjnAhXR2qQKHdHLAqIQ4dUDCAY&uact=5"

headers={'sec-fetch-user': '?1', 'sec-fetch-mode': 'navigate', 'accept-language': 'en-US,en;q=0.9,hu;q=0.8,es;q=0.7', 'accept-encoding': 'gzip, deflate, br', 'sec-fetch-site': 'same-origin', 'authority': 'www.google.com', 'upgrade-insecure-requests': '1', 'dnt': '1', 'referer': 'https', 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9', 'pragma': 'no-cache', 'cache-control': 'no-cache', 'cookie': 'NID=198=kCV01caKwLRWW7DwscdMBx3ghFYxwazNyYlBgcwvVcd6NbUxeDgpsfy5bksxQ3Bs4gLyW7zr-covdTENsNTdjnAcxoaiKz7gEuDOIXcu6Bax_c2RrUiY2uyBRCV9gdXt37jpJ0LzEo-cSUpBHmqkUP3LH_KLQjKAsfIhLfT9QGo; CONSENT=WP.283b16; 1P_JAR=2020-02-17-11', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36'}

params=

Clone this wiki locally