Fix this problem Quick!

Hello EveryOne.
I’m junior students who is studying python.
I 've studied coureses and exercise this.
In this period , I have special problem.
Here…
von = input("Type:31.08.2022 — Enter Von: ")

bis = input("Type:31.08.2022 — Enter Bis: ")

url_link = “https://www.nettranz.de/DatenRegelenergie/reBAP/reBAP

response = requests.get(url_link)

html = response.text

doc = BeautifulSoup(html, “html.parser”)

print(doc.find(id = “dnn_ctr1578_View_rdpGridDownloadStartDate_dateInput”)[“value”])

doc.find(id = “dnn_ctr1578_View_rdpGridDownloadStartDate_dateInput”)[“value”] = von
But input value has not changed to von value. I don’t know this reason.
So require your help…

1 Like

@lnoh2fpzab I could not access the url.

1 Like

sorry about that
https://www.netztransparenz.de/Daten-zur-Regelenergie/reBAP/reBAP
this is real Url . Ask your help. Thank you.

1 Like

Hello @lnoh2fpzab,

I tried your code and it does work on my computer. I typed the value for von and the input changed accordingly.

Here’s what I’ve tried:

from bs4 import BeautifulSoup
import requests

von = input("Type:31.08.2022 — Enter Von: ")
bis = input("Type:31.08.2022 — Enter Bis: ")

url_link = "https://www.netztransparenz.de/Daten-zur-Regelenergie/reBAP/reBAP"

response = requests.get(url_link)

html = response.text

doc = BeautifulSoup(html, "html.parser")

# BEFORE von
before = doc.find(id = "dnn_ctr1578_View_rdpGridDownloadStartDate_dateInput")["value"]
print(before)

# AFTER von
doc.find(id = "dnn_ctr1578_View_rdpGridDownloadStartDate_dateInput")["value"] = von
after = doc.find(id = "dnn_ctr1578_View_rdpGridDownloadStartDate_dateInput")["value"]
print(after)

Can you point me out what I could have missed?

1 Like