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

Error: AttributeError: module 'collections' has no attribute 'Callable' #22

Open
strech345 opened this issue Jan 16, 2023 · 1 comment

Comments

@strech345
Copy link

strech345 commented Jan 16, 2023

Hey,
would like to get this script to run, but got error. In config if commentout google api stuff, or is this really needed?
I used Python v3.
What im doing wrong?

ubuntu:~/flathunter-master$ python3 flathunter.py
[2023/01/16 14:10:51|flathunter.py     |INFO    ]: Using config /home/ubuntu/flathunter-master/config.yaml
/home/ubuntu/flathunter-master/flathunter.py:65: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is                                   unsafe. Please read https://msg.pyyaml.org/load for full details.
  config = yaml.load(config_handle.read())
[2023/01/16 14:10:51|idmaintainer.py   |INFO    ]: already processed: 0
Traceback (most recent call last):
  File "/home/ubuntu/flathunter-master/flathunter.py", line 89, in <module>
    main()
  File "/home/ubuntu/flathunter-master/flathunter.py", line 85, in main
    launch_flat_hunt(config)
  File "/home/ubuntu/flathunter-master/flathunter.py", line 43, in launch_flat_hunt
    hunter.hunt_flats(config, searchers, id_watch)
  File "/home/ubuntu/flathunter-master/flathunter/hunter.py", line 27, in hunt_flats
    results = searcher.get_results(url)
  File "/home/ubuntu/flathunter-master/flathunter/crawl_wggesucht.py", line 19, in get_results
    soup = self.get_page(search_url, page_no)
  File "/home/ubuntu/flathunter-master/flathunter/crawl_wggesucht.py", line 41, in get_page
    return BeautifulSoup(resp.content, 'html.parser')
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/__init__.py", line 228, in __init__
    self._feed()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/__init__.py", line 289, in _feed
    self.builder.feed(self.markup)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/builder/_htmlparser.py", line 215, in feed
    parser.feed(markup)
  File "/usr/lib/python3.10/html/parser.py", line 110, in feed
    self.goahead(0)
  File "/usr/lib/python3.10/html/parser.py", line 178, in goahead
    k = self.parse_html_declaration(i)
  File "/usr/lib/python3.10/html/parser.py", line 269, in parse_html_declaration
    self.handle_decl(rawdata[i+2:gtpos])
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/builder/_htmlparser.py", line 153, in handle_decl
    self.soup.endData()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/__init__.py", line 365, in endData
    self.object_was_parsed(o)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/__init__.py", line 370, in object_was_parsed
    previous_element = most_recent_element or self._most_recent_element
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/element.py", line 1054, in __getattr__
    return self.find(tag)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/element.py", line 1292, in find
    l = self.find_all(name, attrs, recursive, text, 1, **kwargs)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/element.py", line 1313, in find_all
    return self._find_all(name, attrs, text, limit, generator, **kwargs)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/element.py", line 528, in _find_all
    strainer = SoupStrainer(name, attrs, text, **kwargs)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/element.py", line 1610, in __init__
    self.text = self._normalize_search_value(text)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/bs4/element.py", line 1615, in _normalize_search_value
    if (isinstance(value, str) or isinstance(value, collections.Callable) or hasattr(value, 'match')
AttributeError: module 'collections' has no attribute 'Callable'
@teabag12
Copy link

teabag12 commented Oct 3, 2023

try using an older Python version when running flathunter.py. For me Python 3.6 worked

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

2 participants