16 lines
582 B
Python
16 lines
582 B
Python
import requests
|
|
|
|
url = "https://www.handwerk.koeln/innungen/innungen-kh/"
|
|
headers = {
|
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
|
|
}
|
|
|
|
try:
|
|
response = requests.get(url, headers=headers)
|
|
response.raise_for_status()
|
|
with open("cologne_duesseldorf_data/cologne_innungen.html", "w", encoding="utf-8") as f:
|
|
f.write(response.text)
|
|
print(f"Successfully downloaded {len(response.text)} characters.")
|
|
except Exception as e:
|
|
print(f"Error downloading: {e}")
|