Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How can i improve my python web scrape code? [closed]

$
0
0

How can i improve my python web scrape to be more elegant? It took me a while to think of how to get the information i wanted to output but i don't think it is efficient. I'd like to see how this could be written differently and/or better than what i thought of thank you.

import requests as rimport bs4resp = r.get("https://www.python.org/jobs/")pysoup = bs4.BeautifulSoup(resp.text, features="html.parser")for link in pysoup.find_all("a"):    x = link.get("href")    if x[6:10].isdigit():    print("https://www.python.org/jobs/" + x[6:10])`

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>