Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Problem parsing website html file
#1
Hi Guys,

I am trying to parse this web link (http://insight.toba.fun/address/TVAWF6eD...sigfWK2oRB) using Python3 and requests. When we click the link it loads the details of the account. However, when calling from requests, it does not generate the HTML page that can be obtained by clicking the link. I tried putting a delay but didn't work. I'm unable to get the account the info using python. Can anyone point out a solution for this?
I tried using selenium webdriver, but I'm unable to find the search box in the html.

import requests
url='http://insight.toba.fun/address/TVAWF6eDfW9MRdLitCb7ag41sigfWK2oRB'
r = requests.get(url,verify=False)
print(r.text)
Quote
#2
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)
Quote
#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.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Sending file html ? JohnnyCoffee 3 128 Sep-06-2019, 04:32 PM
Last Post: snippsat
  download pdf file from website m_annur2001 1 248 Jun-21-2019, 05:03 AM
Last Post: j.crater
  XML parsing and generating HTML page Python 3.6 Madhuri 2 639 Aug-24-2018, 02:48 PM
Last Post: snippsat
  Reading a html file peterl 4 594 Aug-20-2018, 03:16 PM
Last Post: peterl
  html to text problem Kyle 4 1,107 Apr-27-2018, 09:02 PM
Last Post: snippsat
  Multi-Threaded Alexa Website Ranker Problem - All Threads Doing Same Task digitalmatic7 0 626 Feb-28-2018, 09:21 AM
Last Post: digitalmatic7
  bs4 : output html content into a txt file smallabc 2 8,508 Jan-02-2018, 04:18 PM
Last Post: snippsat
  How to print particular text areas fron an HTML file (not site) Chris 10 2,207 Dec-11-2017, 09:20 AM
Last Post: j.crater
  show csv file in flask template.html rr28rizal 5 14,402 Nov-12-2017, 01:53 PM
Last Post: rr28rizal
  read text file using python and display its output to html using django amit 0 10,271 Jul-23-2017, 06:14 AM
Last Post: amit

Forum Jump:


Users browsing this thread: 1 Guest(s)