| | |
Screen Scraping - part deux
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: May 2008
Posts: 11
Reputation:
Solved Threads: 0
I have written a script that scrapes a particular website and returns the date of an article, description and url. I want to display this information on the console with clickable text so that when I click on text/link called "site" it will open the url of the article in my default browser.
I have been searching google for the best way to do this but I have not found too much. Should I use curses, if so, I am not sure which curses module I should use. Or is there a better/easier way?
Any ideas?
I have been searching google for the best way to do this but I have not found too much. Should I use curses, if so, I am not sure which curses module I should use. Or is there a better/easier way?
Any ideas?
You want to create a hyperlink within the terminal window? I don't know if that would be possible through standard means, and using curses would be overkill in my opinion.
Does this script require to be used within the terminal or would you be willing to give it a nice GUI with wxPython or similar? That way you could easily implement hyperlinks.
If you wanted to keep it within the terminal, you could list a letter before each link, a la:
A) www.google.com
B) www.etc.com
C) www.foo.bar
And then have a
Does this script require to be used within the terminal or would you be willing to give it a nice GUI with wxPython or similar? That way you could easily implement hyperlinks.
If you wanted to keep it within the terminal, you could list a letter before each link, a la:
A) www.google.com
B) www.etc.com
C) www.foo.bar
And then have a
raw_input('Enter a letter to go to that website, exit to quit: ') or something similar, which would then call the default browser via the webbrowser module. Last edited by jlm699; Nov 14th, 2008 at 1:02 pm.
Ah i have had this problem before. I found it really really useful to use Threading.
So maybe you could make a function or class that uses Threading and then you can have it wait for user input while the rest of the program goes its own way.
So maybe you could make a function or class that uses Threading and then you can have it wait for user input while the rest of the program goes its own way.
Make it idiot proof and someone will make a better idiot.
Check out my Site | and join us on IRC | Python Specific IRC
Check out my Site | and join us on IRC | Python Specific IRC
Why not use GUI as Jlm699 suggested. Wxpython have nice HTML window which will make your program look nice!
+1 for jlm699 - GUI makes it easier
+1 for jlm699 - GUI makes it easier
![]() |
Other Threads in the Python Forum
- Previous Thread: How to detect a click in a grid cell?
- Next Thread: wxPython and opencv
| Thread Tools | Search this Thread |
Tag cloud for Python
abrupt ansi anti apache approximation array basic beginner book builtin calculator chmod code converter countpasswordentry curved dan08 dictionaries dictionary dynamic examples excel file filename float format ftp function gui heads homework import inches input java launcher library line lines linux list lists loop mouse mysql mysqlquery newb number numbers numeric output parsing path phonebook plugin port prime program programming progressbar projects py2exe pygame pyqt pysimplewizard python random recursion recursive redirect scrolledtext server software ssh stamp statictext statistics string strings table terminal text textarea thread threading time tkinter tlapse trick tuple tutorial twoup ubuntu unicode urllib urllib2 variable windows wordgame wxpython






