venthur / immoscrapy

Scrape Immobilienscout24 data using Python
MIT License
6 stars 1 forks source link

Where is the result saved? #9

Closed chris-aeviator closed 2 years ago

chris-aeviator commented 2 years ago

I'm getting a tiny overview of the result table and would like to save the result into a CSV but cannot find any documentation about it.

                                                    url    creation  ... built_in_kitchen garden
0     https://www.immobilienscout24.de/expose/133467078  2022-05-05  ...             true   true
1     https://www.immobilienscout24.de/expose/117126387  2020-04-09  ...             true   true
2     https://www.immobilienscout24.de/expose/132845476  2022-04-01  ...             true  false
3     https://www.immobilienscout24.de/expose/132872297  2022-04-01  ...             true  false
4     https://www.immobilienscout24.de/expose/132385890  2022-03-03  ...             true  false
...                                                 ...         ...  ...              ...    ...
1293   https://www.immobilienscout24.de/expose/62443284  2011-10-14  ...            false  false
1294   https://www.immobilienscout24.de/expose/57409239  2022-03-14  ...             true  false
1295   https://www.immobilienscout24.de/expose/45278467  2008-03-26  ...            false   true
1296   https://www.immobilienscout24.de/expose/34986103  2021-04-12  ...             true   true
1297   https://www.immobilienscout24.de/expose/31270863  2022-02-16  ...            false   true

[1298 rows x 10 columns]

UPDATE: actually adding df.to_csv('out.csv') inside cli.py: pretty_print makes this library useful - what do you do with the condesend table otherwise?

Lama09 commented 2 years ago

Using the module immoscrapy rather then the cli-Version might be a option? import immoscrapy import pandas as pd immo_data = pd.DataFrame(immoscrapy.query('de','sachsen', 'chemnitz', 'HOUSE_BUY',price=900000)) immo_data.to_csv('out.csv')

chris-aeviator commented 2 years ago

ok good option - maybe this differs in your environment, but the condensed pandas output is not very valuable other than for a tech demo and I wondered why you chose to make this the main feature. Your comment helped and I'll close this.

EDIT: just realized you are not the author @Lama09 , thanks for providing this hint