remove other examples
parent
bf4ed201ee
commit
c2165d2ba8
|
@ -1,141 +0,0 @@
|
||||||
{
|
|
||||||
"cells": [
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "cb48903e-5021-49fe-9688-45cd0bc05d0f",
|
|
||||||
"metadata": {
|
|
||||||
"is_executing": true
|
|
||||||
},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"from homeharvest import scrape_property\n",
|
|
||||||
"import pandas as pd"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "156488ce-0d5f-43c5-87f4-c33e9c427860",
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"pd.set_option('display.max_columns', None) # Show all columns\n",
|
|
||||||
"pd.set_option('display.max_rows', None) # Show all rows\n",
|
|
||||||
"pd.set_option('display.width', None) # Auto-adjust display width to fit console\n",
|
|
||||||
"pd.set_option('display.max_colwidth', 50) # Limit max column width to 50 characters"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "1c8b9744-8606-4e9b-8add-b90371a249a7",
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"# check for sale properties\n",
|
|
||||||
"scrape_property(\n",
|
|
||||||
" location=\"dallas\",\n",
|
|
||||||
" listing_type=\"for_sale\"\n",
|
|
||||||
")"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "aaf86093",
|
|
||||||
"metadata": {
|
|
||||||
"collapsed": false,
|
|
||||||
"jupyter": {
|
|
||||||
"outputs_hidden": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"# search a specific address\n",
|
|
||||||
"scrape_property(\n",
|
|
||||||
" location=\"2530 Al Lipscomb Way\",\n",
|
|
||||||
" listing_type=\"for_sale\"\n",
|
|
||||||
")"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "ab7b4c21-da1d-4713-9df4-d7425d8ce21e",
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"# check rentals\n",
|
|
||||||
"scrape_property(\n",
|
|
||||||
" location=\"chicago, illinois\",\n",
|
|
||||||
" listing_type=\"for_rent\"\n",
|
|
||||||
")"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "af280cd3",
|
|
||||||
"metadata": {
|
|
||||||
"collapsed": false,
|
|
||||||
"jupyter": {
|
|
||||||
"outputs_hidden": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"# check sold properties\n",
|
|
||||||
"properties = scrape_property(\n",
|
|
||||||
" location=\"90210\",\n",
|
|
||||||
" listing_type=\"sold\",\n",
|
|
||||||
" past_days=10\n",
|
|
||||||
")\n",
|
|
||||||
"display(properties)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "628c1ce2",
|
|
||||||
"metadata": {
|
|
||||||
"collapsed": false,
|
|
||||||
"is_executing": true,
|
|
||||||
"jupyter": {
|
|
||||||
"outputs_hidden": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"# display clickable URLs\n",
|
|
||||||
"from IPython.display import display, HTML\n",
|
|
||||||
"properties['property_url'] = '<a href=\"' + properties['property_url'] + '\" target=\"_blank\">' + properties['property_url'] + '</a>'\n",
|
|
||||||
"\n",
|
|
||||||
"html = properties.to_html(escape=False)\n",
|
|
||||||
"truncate_width = f'<style>.dataframe td {{ max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }}</style>{html}'\n",
|
|
||||||
"display(HTML(truncate_width))"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"metadata": {
|
|
||||||
"kernelspec": {
|
|
||||||
"display_name": "Python 3 (ipykernel)",
|
|
||||||
"language": "python",
|
|
||||||
"name": "python3"
|
|
||||||
},
|
|
||||||
"language_info": {
|
|
||||||
"codemirror_mode": {
|
|
||||||
"name": "ipython",
|
|
||||||
"version": 3
|
|
||||||
},
|
|
||||||
"file_extension": ".py",
|
|
||||||
"mimetype": "text/x-python",
|
|
||||||
"name": "python",
|
|
||||||
"nbconvert_exporter": "python",
|
|
||||||
"pygments_lexer": "ipython3",
|
|
||||||
"version": "3.10.11"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nbformat": 4,
|
|
||||||
"nbformat_minor": 5
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
from homeharvest import scrape_property
|
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
# Generate filename based on current timestamp
|
|
||||||
current_timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
||||||
filename = f"HomeHarvest_{current_timestamp}.csv"
|
|
||||||
|
|
||||||
properties = scrape_property(
|
|
||||||
location="San Diego, CA",
|
|
||||||
listing_type="sold", # or (for_sale, for_rent)
|
|
||||||
past_days=30, # sold in last 30 days - listed in last x days if (for_sale, for_rent)
|
|
||||||
# pending_or_contingent=True # use on for_sale listings to find pending / contingent listings
|
|
||||||
# mls_only=True, # only fetch MLS listings
|
|
||||||
# proxy="http://user:pass@host:port" # use a proxy to change your IP address
|
|
||||||
)
|
|
||||||
print(f"Number of properties: {len(properties)}")
|
|
||||||
|
|
||||||
# Export to csv
|
|
||||||
properties.to_csv(filename, index=False)
|
|
||||||
print(properties.head())
|
|
Loading…
Reference in New Issue