Compare commits
No commits in common. "8c6b672d9010a59e879206d60f9d03a1a7558c7b" and "c6d39ee5799c2a8a6864b97a60fb91dfd4806844" have entirely different histories.
8c6b672d90
...
c6d39ee579
@ -1,8 +1,3 @@
|
||||
# Requirements
|
||||
|
||||
`apt install python3-pydantic python3-httpx python3-bs4 python3-tqdm locales-all && sudo locale-gen`
|
||||
|
||||
# Windows build
|
||||
1. install wine
|
||||
2. create venv and `pip install .`
|
||||
3. `wine pyinstaller --paths=venv/lib/python3.10/site-packages/ --collect-submodules=lxml --onefile scraperoog/scrape.py`
|
||||
|
@ -1,16 +0,0 @@
|
||||
[project]
|
||||
name = "scraperoog"
|
||||
version = "0.0.2"
|
||||
dependencies = [
|
||||
"tqdm",
|
||||
"bs4",
|
||||
"lxml",
|
||||
"httpx",
|
||||
"pydantic",
|
||||
]
|
||||
|
||||
[tool.setuptools.packages]
|
||||
find = {}
|
||||
|
||||
[project.scripts]
|
||||
scraperoog = "scraperoog.scrape:main"
|
@ -81,7 +81,7 @@ def convert_to_datestring(day: str, month: str, year: str) -> datetime:
|
||||
|
||||
async def request_data(index: int, client: AsyncClient) -> Optional[Entry]:
|
||||
response_data = await client.get(DATA_URL + str(index), timeout=20.0)
|
||||
if "Die Darstellung ist derzeit deaktiviert" not in response_data.text:
|
||||
if "Fehler aufgetreten" not in response_data.text:
|
||||
response_title = await client.get(MAIN_URL + str(index), timeout=20.0)
|
||||
title_soup = BeautifulSoup(response_title.text, "lxml")
|
||||
apartment = (
|
||||
@ -127,12 +127,10 @@ async def extract_results() -> None:
|
||||
file.write(result.json())
|
||||
generate_csv(result)
|
||||
|
||||
def main() -> None:
|
||||
if platform.system() == "Windows":
|
||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||
asyncio.run(extract_results())
|
||||
|
||||
if __name__ == "__main__":
|
||||
# with open("results.json", "r") as file:
|
||||
# result = Result(**json.load(file))
|
||||
main()
|
||||
if platform.system() == "Windows":
|
||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||
asyncio.run(extract_results())
|
Loading…
x
Reference in New Issue
Block a user