1

I have a code

from bs4 import BeautifulSoup as bs
import random
import lxml.html

r = requests.get("https://osu.ppy.sh/beatmapsets?q=S3rl")
text = r.text
soup = bs(text, "html.parser")
theresult = {}
for qwerty in soup.find_all('a'):
    theresult[i] = qwerty.get('href')

enter image description here

But I don’t get the links I need from this code, but I don’t know how to get it. Disabling java doesn't help. How do I get all the download links such as in the picture?

  • What picture are you referring to? Also, what do you mean by "Disabling java doesn't help"? – Jack Fleeting Nov 01 '19 at 11:36
  • Sorry, I didn’t immediately notice that I can’t add pictures. Have all the cards that the search gives. And under Java, I have a view that when Java is turned off, the page code looks different - as request understands it (from one of my questions, it was advised to disable Java for this) – Dobrodeetel Nov 01 '19 at 12:33
  • Yes, this page is loaded dynamically using jscript. You'll need to use something like Selenium. – Jack Fleeting Nov 01 '19 at 13:08
  • Is it possible to tell how to get links specifically from BeautifulSoup – Dobrodeetel Nov 01 '19 at 13:52
  • I'm afraid neither BeautifulSoup nor lxml can do it. There may be a somewhat convuluted way (or two) of doing it without Selenium, though I haven't tried it myself. [Take a look at this and please report back if it works :)](https://stackoverflow.com/questions/41200450/multiple-urls-copy-in-sources-network-tab). – Jack Fleeting Nov 01 '19 at 15:08
  • unfortunately I can’t say since I decided to redo the code for selenium and that’s all I wanted - I got it) – Dobrodeetel Jul 14 '20 at 14:10

0 Answers0