-
Notifications
You must be signed in to change notification settings - Fork 23
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
Question about "all connections are in use" #5
Comments
Hey @djkpf, thanks for using it :) Looks like you're doing some really cool stuff. Would it be possible for you to share the code you're using? This is an unknown error for me and this way would be easier to find what's causing it. By the message, my guess is that something weird is going on while you connect to the website, which could be solved by taking it easier (giving R some time between making each connection, for example), but it's difficult to tell without the code. |
Hi there, Thanks so much. I don't ask many questions on github, but I will do my best. Using the following data: https://github.com/djkpf/pop-chords/blob/master/sampledata_chorrrds.csv, I run the following code:
It is when I save that I get the error:
|
Great, thanks! So, let's get into the issue: It looks to me that you created the URLs with the name of the song and the artist, but actually, the Cifraclub doesn't work like this. Unfortunately, not all songs are available on the website. This is why the most common usage is to provide an artist to the What I've done in the following code, which uses your
...but a big issue in this is that I searched for some of the artists and songs manually, and some of them don't even exist in Cifraclub ): That might lead you to end up with a smaller dataset. (the code can be slow)
The results of this should be what you'll use in the |
Thanks! So one thing I should clarify is that what I was doing was working perfectly besides the error I received when I saved: All of the data collection actually worked perfectly. I was getting data from all the urls that existed. My only issue was that I couldn't save it because the connections were open. Could it be because it uses parallel processing? I also used what you did and the data collection worked, but I could not save. |
Yes, sorry about that! You can just close the connections after scraping each URL, something like this:
|
Answering your question: no, it doesn't do anything in parallel, I need to look deeper to find the true source of this error. Thanks for pointing it out! |
This did the trick. Thanks so much for your help!!! Will let you know when story is finished. |
It sounds like connections are being left open by possibly either by But running |
Absolutely loving this package! Thank you.
With the permission of Cifra Club, I am using it to scrape the chords of the top 10 hits in the US going back many decades. When I run a large batch of urls, the package works well, but when I try to save my result, I get
Error in file(con, "r") : all connections are in use
I wonder whether this is a known issue, and if there is something I should be doing differently.
Thanks!
The text was updated successfully, but these errors were encountered: