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
  Create .exe file for Python flask website. vintysaw 2 61 Yesterday, 08:50 AM
Last Post: vintysaw
  Sending file html ? JohnnyCoffee 3 208 Sep-06-2019, 04:32 PM
Last Post: snippsat
  download pdf file from website m_annur2001 1 310 Jun-21-2019, 05:03 AM
Last Post: j.crater
  XML parsing and generating HTML page Python 3.6 Madhuri 2 753 Aug-24-2018, 02:48 PM
Last Post: snippsat
  Reading a html file peterl 4 712 Aug-20-2018, 03:16 PM
Last Post: peterl
  html to text problem Kyle 4 1,318 Apr-27-2018, 09:02 PM
Last Post: snippsat
  Multi-Threaded Alexa Website Ranker Problem - All Threads Doing Same Task digitalmatic7 0 671 Feb-28-2018, 09:21 AM
Last Post: digitalmatic7
  bs4 : output html content into a txt file smallabc 2 9,950 Jan-02-2018, 04:18 PM
Last Post: snippsat
  How to print particular text areas fron an HTML file (not site) Chris 10 2,314 Dec-11-2017, 09:20 AM
Last Post: j.crater
  show csv file in flask template.html rr28rizal 5 15,859 Nov-12-2017, 01:53 PM
Last Post: rr28rizal

Forum Jump:


Users browsing this thread: 1 Guest(s)