Demo entry 6760376

test

   

Submitted by anonymous on Sep 13, 2018 at 09:20
Language: Python 3. Code size: 564 Bytes.

from bs4 import BeautifulSoup as bs
from urllib.parse import urljoin

fr=open("c:\\temp\\longlist.html",'rb')
page_html=fr.read()
fr.close()

page_soup = bs(page_html, "html.parser")
containers = page_soup.findAll("div", {"class":"mb-1"})

print(len(containers))

fw=open("c:\\temp\\ziplist-long.txt", "w")

for container in containers:
	projname = container.a.text
	link = container.a.get("href")
	projlink = urljoin("https://github.com/", link)
	codelink = projlink + "/archive/master.zip\n"
	print(codelink)
	fw.write(codelink)

fw.close()

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).