Skip to content
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: module 'urllib' has no attribute 'urlopen' #66

Closed
fferraro87 opened this issue Mar 14, 2017 · 15 comments
Closed

AttributeError: module 'urllib' has no attribute 'urlopen' #66

fferraro87 opened this issue Mar 14, 2017 · 15 comments

Comments

@fferraro87
Copy link

Hi,
i'm trying to use this tool on my arch OS.
i've this error :

Traceback (most recent call last):
  File "./dnsrecon.py", line 1664, in <module>
    main()
  File "./dnsrecon.py", line 1622, in main
    spf_enum, do_whois, zonewalk)
  File "./dnsrecon.py", line 1067, in general_enum
    goo_rcd = goo_result_process(res, scrape_google(domain))
  File "./dnsrecon.py", line 531, in scrape_google
    sock = urllib.urlopen(url)
AttributeError: module 'urllib' has no attribute 'urlopen'

what i've to install?
thanks

@darkoperator
Copy link
Owner

darkoperator commented Mar 14, 2017 via email

@fferraro87
Copy link
Author

Python 3.6.0, i've already install dnspython and netaddr via pip

@darkoperator
Copy link
Owner

darkoperator commented Mar 14, 2017 via email

@fferraro87
Copy link
Author

Ah ok thanks for your help

@palnabarun
Copy link

@darkoperator Hey. I refactored the code but that threw up a HTTP403:Forbidden. I think Google servers are rejecting requests from urllib python.

PS: I do not ping Google servers using scripts that often, so blocking my IP is not an option.

@palnabarun
Copy link

@darkoperator Using requests in Python3.5.2 though solves the problem. Moreover, the function unique does not work in Python3, so a workaround by using set is to be done.

@CerebralMischief
Copy link

Any updates on this? I'm running into this problem across various shells and have resorted to using Kali Linux and avoid updating Python there - this isn't ideal and I'd rather see the issue fixed here. I personally don't know Python well enough to make the change or I would take care of it myself and submit a PR. Though I see other PR's have been open for a while so I'm wondering if @darkoperator is even working on this any longer. (I hope so!) :) Thank you in advance.

@darkoperator
Copy link
Owner

@CerebralMischief not abandone, just need to set time to figure how to keep it compatible with python 2.7 and 3.x and python breaking stuff in minor changes does not help, specially since Python is not a strength of mine

@CerebralMischief
Copy link

I'm so happy to hear you're still working on this project! Thank you for taking the time to respond. I am in the same boat, I don't know Python very well or I'd happily work on a fix and submit a PR. Maybe I can try to dig in and learn it as I'd love to help you. :)

@darkoperator
Copy link
Owner

Actually thinking of removing the Google feature. It is against Google terms of service and it is not actually a DNS enumeration technique. While testing I banned my IP for a while.

@darkoperator
Copy link
Owner

Pushed a fix to master. Test and let me know if it fixed the issue.

@sokeyo
Copy link

sokeyo commented Jul 18, 2018

make sure you import requests from urllib, then try this format, it worked for me:

from urllib import request
urllib.request.urlopen( )

@JohnnyFun
Copy link

If it helps anyone, my particular issue was that the file I was running was called http.py. Once I changed the name to test-http.py, importing urllib.request resolved the error "AttributeError: module 'urllib' has no attribute 'request'"--further up the exception trace the internal packages were trying to fetch a module called 'http'...

@yanxg
Copy link

yanxg commented Aug 19, 2020

Change urllib.urlopen to urllib.request.urlopen in python3 might help. It solves my bug.

@tilaktok
Copy link

[!] Something went wrong, printing the error: module 'urllib' has no attribute 'urlopen'

getting error while cloning help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants