-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
>AttributeError: 'NoneType' object has no attribute 'find'< on certain connections #14
Comments
It looks like some reason a different HTML source code is returned when the search involves Edit: It looks like this bug only occurs in the latest release As a temporary workaround i suggest downgrading to |
Hm, according to https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/sensor/deutsche_bahn.py, version 0.20 is specified already? |
… also, it’s currently working again. |
Merged fix from @mkuhlmann and released new package on PyPI as version |
Hey guys, I've installed version 0.22 but the bug seem to persist for some connections. `
` Maybe the html helps you debugging: |
Hey! A while ago I've written It would be cool to build a Python port/clone, so that all of you can fetch HAFAS data from the environment you use. Let me know if you need assistance. |
The last time I had parsing issues with this library I rewrote Schiene to use the HAFAS api (thanks for your hafas-client @derhuerst) but keep the same functions and their signatures so it works as a drop in replacement. Maybe you have use for this: https://github.com/dominik-th/schiene2 Sample output of a connection with delay: (I've never worked with python before, so please take a look on the code and fix things if you find anything) |
I appreciate the effort, but arguably it's lacking quite a few features. If you want, we can make this a fully featured client. |
Thanks to you both! Nice to hear that there are some projects going on at the moment - and that they are not relying on parsing HTML. :D |
Keep in mind that |
Yeah I've just seen that while playing around a little. One connection that was canceled was not marked so in the output for example. Let's see what further investigations will show. Unfortunately I'm a python noob, otherwise I would offer my help! |
Another shameless plug: You can always use our public API wrapping the DB HAFAS endpoint. (This of course adds one more centralised component to the system.) |
I personally think that another server dependency wouldn't be the perfect choice. Another library dependency wouldn't hurt probably. Assuming DB's API will stay around, I have the impression, your JS implementation of the API is quite sophisticated. So, I wonder wouldn't it be possible to simply wrap it in Python (instead of porting it)? That way, API changes on the DB side would need handling only once. A quick look around pointed me to JS2PY. It is said to interpret virtually any JS code. What do you think? Schiene3 is coming? ;-) https://pypi.org/project/Js2Py/ PS: For reference, there is an issue for this subject already: #1 |
I've proceeded with the discussion in |
I tried using Schiene as a home assistant sensor but after the first try—it did work for a brief amount of time—, the underlying library stopped working.
The problematic connection for me has been from Leverkusen Mitte to Köln Hansaring
Home Assistant Log
Command Line
I tried using Schiene directly using the command line but the same error arose.
The text was updated successfully, but these errors were encountered: