Comments (18)
@shivankar-madaan Thank you for raising the issue. @KingAkeem Please confirm this.
from torbot.
I can't reproduce the error, I just tried it out and it worked fine for me. Could you give me some more details of your system?
from torbot.
@KingAkeem did you have the Tor service as not running?
from torbot.
No it's running, if it weren't running then I wouldn't be able to connect to the .onion website.
from torbot.
Here are my details
Attempting to connect to https://check.torproject.org/
Attempting to connect to https://check.torproject.org/
Attempting to connect to https://check.torproject.org/
Traceback (most recent call last):
File "torBot.py", line 186, in <module>
main(conn=True)
File "torBot.py", line 158, in main
print("Tor IP Address :", pagereader.get_ip())
File "/tmp/TorBoT/modules/pagereader.py", line 102, in get_ip
pg = page.find('strong')
AttributeError: 'NoneType' object has no attribute 'find'
[root@ip-10-96-16-124 TorBoT]# python -V
Python 3.6.0
[root@ip-10-96-16-124 TorBoT]#
[root@ip-10-96-16-124 TorBoT]# service tor status
tor is not running```
from torbot.
@KingAkeem He is running without the tor services being started.
@shivankar-madaan Are you saying that to handle the exception in a neat way?
from torbot.
yes @PSNAppz
from torbot.
I think thats a good idea. @KingAkeem What do you think?
from torbot.
I understand now, I thought you were saying that it didn't work correctly. What would you think a better method of handling the exception be? Currently it attempts to connect to a site three times, then raises an error which gives a description that tells the user how many times the connection was attempted and why it failed.
from torbot.
@PSNAppz I'm open to suggestions
from torbot.
I am not sure about how right the solution is to be
But the I think if condition is not rightly written
It should be modified something like this
if type(err) == HTTPError:
raise("There has been an HTTP error after three attempts.")
if type(err) == ConnectionError:
raise("There has been a connection error after three attempts.")
And with this we get a different error
Attempting to connect to https://check.torproject.org/
Attempting to connect to https://check.torproject.org/
Traceback (most recent call last):
File "torBot.py", line 186, in <module>
main(conn=True)
File "torBot.py", line 158, in main
print("Tor IP Address :", pagereader.get_ip())
File "/tmp/TorBoT/modules/pagereader.py", line 103, in get_ip
page = read_first_page('https://check.torproject.org/')
File "/tmp/TorBoT/modules/pagereader.py", line 52, in read_first_page
raise("There has been a connection error after three attempts.")
TypeError: exceptions must derive from BaseException```
from torbot.
@shivankar-madaan type(err) == ConnectionError
returns False. The correct form is err == ConnectionError
from torbot.
@shivankar-madaan Would you like to talk in our slack channel? If yes, please post your emil for the invitation.
from torbot.
sure @PSNAppz
from torbot.
@KingAkeem with type(err) the code flow is able to reach to the raise("There has been a connection error after three attempts")
But with the usual code we are reaching to
File "torBot.py", line 186, in <module>
main(conn=True)
File "torBot.py", line 158, in main
print("Tor IP Address :", pagereader.get_ip())
File "/tmp/TorBoT/modules/pagereader.py", line 102, in get_ip
pg = page.find('strong')
AttributeError: 'NoneType' object has no attribute 'find'```
from torbot.
@shivankar-madaan Invited
from torbot.
thanks @PSNAppz
from torbot.
Referencing PR #78
from torbot.
Related Issues (20)
- installation issue HOT 1
- TorBot not searching onion sites HOT 1
- Move log level from environment variable to CLI flag HOT 12
- Connection Refuse Error HOT 1
- TorBot Installation Issue HOT 3
- Help Us Enhance Tests! HOT 4
- Move pull request template HOT 1
- Move markdown files to a docs directory HOT 2
- Add HTML feature HOT 20
- Save links to a database HOT 3
- Add keyword/phrase search HOT 1
- Create docker image HOT 4
- [Docs]:- Adding Contributors Section to the readme.md HOT 4
- Move socks5 env variables to CLI flags
- [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1006) HOT 12
- Feature: Adding contributors section to the README.md file. HOT 4
- Only get the original link when crawling onion sites HOT 10
- UnicodeDecodeError 'charmap'
- Launching with Python3.9 fails with TypeError
- Can't actually find the bug to correct it.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torbot.