ccabrales / TabHero

Python command line tool to search and download guitar tabs from ultimate-guitar.com
MIT License
14 stars 4 forks source link

not sure where to begin #1

Open christopherhastings opened 6 years ago

christopherhastings commented 6 years ago

File "tabhero.py", line 66, in perform_search(args.query, args.select, args.print_tab, args.output_dir) File "tabhero.py", line 30, in perform_search search_results = tabs_search(query) File "/Users/christopherhastings/Downloads/TabHero-master/tabhero_functions.py", line 50, in tabs_search rows = results_table.find_all('tr') # All the results rows in the table AttributeError: 'NoneType' object has no attribute 'find_all'

ccabrales commented 6 years ago

Can you provide a little more info? Like what the full command you ran is, python version, etc. But it looks like the site changed the underlying structure (no longer using tables), so the scraping doesn't work properly. This project would have to be updated to work again, which you are welcome to contribute to.

christopherhastings commented 6 years ago

The command I ran is python3 tabhero.py -p query watson

I have both Python 2.7.1 and Python 3.6.4 on my OS (Mac).

I would love to contribute, but my knowledge of this is very basic. I'm attempting to use this to scrape all of the tabs - and then isolate in each tab which chords are used. My son is eight, and trying to learn to play the guitar, but only wants to learn certain songs, so I'm trying to set a learning path based on music he likes.

What can I do to help?

When I run the sample code, I get a similar error:

python3 tabhero.py -s -p colourblind Searching...

Traceback (most recent call last): File "tabhero.py", line 66, in perform_search(args.query, args.select, args.print_tab, args.output_dir) File "tabhero.py", line 30, in perform_search search_results = tabs_search(query) File "/Users/christopherhastings/Downloads/TabHero-master/tabhero_functions.py", line 50, in tabs_search rows = results_table.find_all('tr') # All the results rows in the table AttributeError: 'NoneType' object has no attribute 'find_all'

ccabrales commented 6 years ago

The main problem is probably in how it scrapes the results. There's no longer a table used in the ultimate-guitar markup. Probably start line 48 of tabhero_functions.py changing the find to get the correct items. The tabs_search function is the most important.

results_table = tabs_soup.find('table', class_="tresults")
luizaq commented 2 years ago

Hello This code would be the solution of my life @ccabrales Have you figured out what they've changed and how to fix it ,.or should I put my reverse engineer hat on?

ccabrales commented 2 years ago

@luizaq I haven't worked on this project in a while so I don't know exactly what they changed. I don't know when I'll have the time to take a look myself, so please feel free to take a shot at updating the scraper. I'm sure they are using different classnames and/or markup for the different sections which shouldn't be too difficult to figure out.