R
R
Ruslan Mordovanech2021-11-08 20:45:09
Python
Ruslan Mordovanech, 2021-11-08 20:45:09

Parsing. I'm getting an error, what's the problem?

import requests


def get_data(url):
    headers = {
        "Accept": "application / json, text / javascript, * / *; q = 0.01",
        "Accept-Encoding": "gzip, deflate, br",
        "Connection": "keep-alive",
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36",
        "X-Requested-With": "XMLHttpRequest"
    }

    r = requests.get(url=url, headers=headers)

    with open("index.html", "w") as file:
        file.write(r.text)
def main():
    get_data("https://pr.zk.court.gov.ua/new.php")

if __name__ == "__main__":
    main()


I tried the code but I get an error code: lmlkhg what's the problem?

Request URL: https://pr.zk.court.gov.ua/new.php
Request method: POST
I need to extract information

maybe I'm moving in the wrong direction?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Satisfied IT, 2021-11-08
specialist @borisdenis

pops up error code: lmlkhg

I have almost exactly the same error when opening your link through the browser error code: hgjfv7, so the problem is in the site. not in code.

L
LordOftheCode, 2021-11-08
@LordOftheCode

url=url just replace with url and print response

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question