May-25-2017, 07:24 PM
(May-20-2017, 03:02 AM)snippsat Wrote: My list is just like in the Pen.
I save it aslist.html
<ul> <li><a href="https://python-forum.io">The best Python forum</a></li> <li><a href=https://google.com>Google</a></li> </ul>Then openlist.html
with webbrowser module as shown.
Or similar as @ichabod801 suggests,the result will be the same.
import os os.startfile("list.html")Quote:I have a list.Have you scraped it as html links?
<a href="https://python-forum.io">The best Python forum</a>
It should be no problem to make this.
I understand! Got it working.
Only problem is I'm having trouble adding an empty line in between each link, despite adding
\n
in my code:links =(soup.find_all('a', class_ ='link')) with open ('Marketwatch.html', 'w') as file: for i in links: file.write(str(i)+ '\n') webbrowser.open('Marketwatch.html')Here is how my output looks
[Image: rm1gU9h]