Advertisement
A_God

REspsa

Jul 25th, 2022
1,213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. import requests
  2.  
  3. respArrar =[]
  4. filename = "test.txt"
  5. for i in range (1,100) :
  6.   url = f"https://schoolsbookonline.com/wp-json/wc/v3/orders?status=completed&page={i}&&per_page=100"
  7.   payload={}
  8.   headers = {
  9.   'Authorization': 'Basic Y2tfNWQ1MjU0MjAxNmJlNTJmMTU2NTc1M2NkMTJlYTE2ZjE2OWExZWI4Nzpjc18xNjFjNDFhYjQ4YzAzNjU2OWU0Mzk5OWQ5OTBiZGU0ODc4NjE1MGNl',
  10.   'Cookie': 'wfwaf-authcookie-c7d8d8a291508289cb73487818cae234=14%7Cadministrator%7Cmanage_options%2Cunfiltered_html%2Cedit_others_posts%2Cupload_files%2Cpublish_posts%2Cedit_posts%2Cread%2Cmanage_network%7Cc6bf6711699482598084d1d3cec1bfc00c0660c9bb2b8b78abe8055d0398c3fd'
  11.   }
  12.   response = requests.request("GET", url, headers=headers, data=payload)
  13.   respArrar.extend(response)
  14. with open(filename, "w") as f:
  15.    f.write(str(respArrar))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement