I've tried using wget in Python to download links from a txt file. What should I use to help me do this?
I've using the wget Python module.
r = requests.get(url)
html = r.text
soup = BeautifulSoup(html, 'html.parser')
body = soup.body
s = "https://google.com/"
for url in soup.find_all('a'):
f = open("output.txt", "a")
print(str(s), file=f, end = '')
print(url.get('href'), file=f)
f.close()
So far I've only been able to create the text file then use wget.exe in the command prompt. I'd like to be able to do all this in 1 step.