Hi. I love this and have a few ideas for adding my own twists on it.
However, using Jupyter Notebook, I get as far as the end of Step 3 - with a nice list of URLs. When I go into Step 4, I get hit with "HTTPError: HTTP Error 403: Forbidden".
I take this to mean that the site is not happy with the bot activity. How do I incorporate a User=Agent into the code to circumvent this? I know how to do this with the requests library, but this is my first time with the urllib library and I am struggling a little :)
Would love your input on this, as it's such a cool looking little project that I would love to complete
Thanks, Ian
Hi Ian, yeah unfortunately this happens. If you look at the GItHub repo, somebody actually merged a PR to help with that.
You can use sleep from Python's time module, and sleep for random intervals while you scrape the lyrics. That way AZLyrics doesn't pick up that you are a bot.
Fortunately, after getting the lyrics you don't have to run it again so you can avoid the ban!
Hi Cat, I just wanted to pop by and say thanks again. I decided to make a few changes to your original code:
Rewrote most of it to use BeautifulSoup, as I understand that module better
Dropped the Markov chains, as they were not really working for me. Made more use of the random module
Created a GUI (which in turn lead to me learning a tonne of stuff about TKinter)
I am now working on a new project and was just wondering how many do employees like to see in a portfolio for entry level software engineers?
Also, does blogging about projects help in gaining employment? I have my own site (ianainslie.uk), so that would be easy to initiate if worthwhile.
Lastly, thanks again for the whole 2.20 videos thing - it lit a fire under my arse to make the transition from tutorial watcher to project maker.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi. I love this and have a few ideas for adding my own twists on it.
However, using Jupyter Notebook, I get as far as the end of Step 3 - with a nice list of URLs. When I go into Step 4, I get hit with "HTTPError: HTTP Error 403: Forbidden".
I take this to mean that the site is not happy with the bot activity. How do I incorporate a User=Agent into the code to circumvent this? I know how to do this with the requests library, but this is my first time with the urllib library and I am struggling a little :)
Would love your input on this, as it's such a cool looking little project that I would love to complete
Thanks, Ian
Hi Ian, yeah unfortunately this happens. If you look at the GItHub repo, somebody actually merged a PR to help with that.
You can use sleep from Python's time module, and sleep for random intervals while you scrape the lyrics. That way AZLyrics doesn't pick up that you are a bot.
Fortunately, after getting the lyrics you don't have to run it again so you can avoid the ban!
Hi Cat, I just wanted to pop by and say thanks again. I decided to make a few changes to your original code:
I am now working on a new project and was just wondering how many do employees like to see in a portfolio for entry level software engineers?
Also, does blogging about projects help in gaining employment? I have my own site (ianainslie.uk), so that would be easy to initiate if worthwhile.
Lastly, thanks again for the whole 2.20 videos thing - it lit a fire under my arse to make the transition from tutorial watcher to project maker.