LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-13-2020, 05:16 AM   #1
KlaasJan
LQ Newbie
 
Registered: Aug 2006
Posts: 28

Rep: Reputation: 0
Read html source when browsing from a python script


In a python script i start the midori browser with subprocess:
subprocess.run(['midori',someurl])
That shows the correct web page.
But now I want to read/use in that same script the data in the source of that web page.
Is That possible ? How ?
 
Old 09-13-2020, 06:19 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
One method to read the web page is urllib. Here is a tutorial (I just casually googled it without trying or even reading in-depth): https://muddoo.com/tutorials/how-to-...-using-python/.

You can also parse and analyse the web page. I believe beautifulsoup is the de-facto standard library for that.
 
Old 09-13-2020, 02:55 PM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Selenium, PhantomJS, or both.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is there a graphical browser which will read local compressed html files (html.gz) ? harryhaller Linux - Software 2 02-18-2014 09:54 AM
How to close open ports using a python script or a shell script in python ?? apanimesh061 Programming 3 11-20-2011 12:31 AM
[SOLVED] How to turn Turtle-speed browsing into penguin-speed browsing?? :D IlIl7 Linux - Newbie 7 10-18-2010 05:21 AM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM
My Network Browsing desktop icon is gone > my network browsing desktop icon i kkempter SUSE / openSUSE 1 01-12-2006 12:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration