Python Forum
Having my output links become clickable
Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having my output links become clickable
#7
(May-20-2017, 03:02 AM)snippsat Wrote: My list is just like in the Pen.
I save it as list.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 open list.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]
Reply


Messages In This Thread
RE: Having my output links become clickable - by bigmit37 - May-25-2017, 07:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Sad "Disabled" Buttons Still Clickable. Nd4SpdSe 6 2,087 Feb-28-2025, 05:00 PM
Last Post: deanhystad
  help with url links- href links don't work properly DeBug_0neZer0 1 2,677 Jan-06-2021, 11:01 PM
Last Post: DeBug_0neZer0
  How to turn screen output into clickable hyperlinks windros 5 3,840 Jan-22-2019, 05:41 PM
Last Post: windros

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020