grantwilliams / wg-gesucht-crawler-cli

Python web crawler / scraper for WG-Gesucht. Crawls the WG-Gesucht site for new apartment listings and send a message to the poster, based off your saved filters and saved text
MIT License
76 stars 28 forks source link

Error #7

Open cami0 opened 5 years ago

cami0 commented 5 years ago

i´m getting this error. Some ideas?


Running until canceled, check info.log for details...
Failed to send message to E A, will try again next time
Traceback (most recent call last):
  File "C:\Users\Lenovo\Miniconda3\Scripts\wg-gesucht-crawler-cli-script.py", line 11, in <module>
    load_entry_point('wg-gesucht-crawler-cli', 'console_scripts', 'wg-gesucht-crawler-cli')()
  File "C:\Users\Lenovo\Miniconda3\lib\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\Lenovo\Miniconda3\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "C:\Users\Lenovo\Miniconda3\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\Lenovo\Miniconda3\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\Lenovo\Miniconda3\lib\site-packages\wg_gesucht\cli.py", line 76, in cli
    wg_gesucht.search()
  File "C:\Users\Lenovo\Miniconda3\lib\site-packages\wg_gesucht\crawler.py", line 309, in search
    self.email_apartment(ad_url, template_text)
  File "C:\Users\Lenovo\Miniconda3\lib\site-packages\wg_gesucht\crawler.py", line 270, in email_apartment
    submit_form_page_soup.find_all('option', selected=True)))[0]['value'],  # Title
IndexError: list index out of range
Stopped running!
nicolasperezdeo commented 5 years ago

Yes, got the same error. It is something when getting the data for sending the message from the ad. If you have a solution please let us know.

Otherwise, I forked the repo and adapted to only store the flats in the .csv file. If someone is interested it is public in my git.

Cheers!

grantwilliams commented 5 years ago

Hiya, WG-Gesucht changed their email templates page, so that you can have multiple templates, you can now pass --template="My template name" as a CLI argument, or just leave it and it will use the first template you have saved. They also changed the way the send message form works. Both things are now fixed if you want to pull the latest changes from master :)

nicolasperezdeo commented 5 years ago

Hey,

Cool, thanks for the update! :)

cami0 commented 5 years ago

Thank you very much @grantwilliams , I gonna check it out

cami0 commented 5 years ago

Hello, I tried the new version and is working, but the names are not getting replaced.

I tried:

"Hallo Submitter, gute Nacht!"

but the String "Submitter" is not getting replaced.

Did the string changed?

I´m I doing something wrong?