✅ Unsuccessfully trying to parse web pages.
I want to parse last.fm for artists but my code works only first iteration, in all iterations where pages > 1
var nodeArtist = document.DocumentNode.QuerySelectorAll("td.chartlist-name");
returns empty list which is strange because pages are identical in structure
12 Replies
ok, so scraping is hard and even harder in C#. check if they have a public api you can consume. if not, check if they have an internal api you can consume through chrone devtools in the networking tab
if they use some unga bunga ancient technology, you probably wouldnt have the error but also, good luck and god speed, i cannot help you further.
they have a public api, I've just never worked with APIs, so I decided to parse the page, it seemed easier to me (ノ_<。)
Good time to learn it. trust me the API will be wayyyy easier. do you know how json works?
actually, checm if theres a nuget package first, if its a public api for a popular service, goos chance someone made one
There is, i will try use it
pog, gl bro, leme know if u need help
ok, big thanks
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
they have a public api, surely with restrictions for whatever isnt tos
my man just wants to programatically know what music he listens to
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
nothin wrong with a little bit of educational web scraping tho 😉
but youre like a mod or something so ill shush xD
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
using an API is easy/very easy. Significantly easier than scraping at least.