Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem parsing website html file
#3
(May-01-2018, 11:04 AM)Larz60+ Wrote:
Quote:However, when calling from requests, it does not generate the HTML page that can be obtained by clicking the link.
You are not saving the file.
add after line 3:
with open('yourfilename', 'w') as f:
    f.write(r.text)
(of course, replace 'yourfilername' with a valid .html file name)

The OP probably meant - page is not rendered properly because of Javascript. Try https://html.python-requests.org/ which can render the page with Chromium.
Reply


Messages In This Thread
Problem parsing website html file - by thefpgarace - May-01-2018, 05:35 AM
RE: Problem parsing website html file - by Larz60+ - May-01-2018, 11:04 AM
RE: Problem parsing website html file - by Standard_user - May-01-2018, 11:09 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with scrapping Website giddyhead 1 1,618 Mar-08-2024, 08:20 AM
Last Post: AhanaSharma
Lightbulb Python Obstacles | Kung-Fu | Full File HTML Document Scrape and Store it in MariaDB BrandonKastning 5 2,879 Dec-29-2021, 02:26 AM
Last Post: BrandonKastning
  show csv file in flask template.html rr28rizal 8 34,717 Apr-12-2021, 09:24 AM
Last Post: adamabusamra
  HTML multi select HTML listbox with Flask/Python rfeyer 0 4,617 Mar-14-2021, 12:23 PM
Last Post: rfeyer
  Login and download an exported csv file within a ribbon/button in a website Alekhya 0 2,649 Feb-26-2021, 04:15 PM
Last Post: Alekhya
  Parsing html page and working with checkbox (on a captcha) straannick 17 11,263 Feb-04-2021, 02:54 PM
Last Post: snippsat
  Help: Beautiful Soup - Parsing HTML table ironfelix717 2 2,669 Oct-01-2020, 02:19 PM
Last Post: snippsat
  Problem with logging in on website - python w/ requests GoldeNx 6 5,281 Sep-25-2020, 10:52 AM
Last Post: snippsat
  Open and read a tab delimited file from html using python cgi luffy 2 2,665 Aug-24-2020, 06:25 AM
Last Post: luffy
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to loop to next HTML/new CSV Row BrandonKastning 0 2,354 Mar-22-2020, 06:10 AM
Last Post: BrandonKastning

Forum Jump:

User Panel Messages

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