View Single Post
Old 05-28-2017, 09:30 PM  
deonbell
Confirmed User
 
deonbell's Avatar
 
Industry Role:
Join Date: Sep 2015
Posts: 1,045
This is ugly, but works. It extracts bitcoin addresses from the page that has been downloaded. I could do better and add curl to the python script to make faster.

Code:
import sys

searchstring = "https://bitinfocharts.com/bitcoin/address/"

searchfile = open("bitcoin.html", "r")
for line in searchfile:
    if searchstring in line:
   #     bitaddress = line.split('"')

        htmlsplit = line.split(searchstring)
        counter = 1
        trimfile = open('trimfile.txt', 'w')
        while counter < 101: 
            left_text = htmlsplit[counter].partition("\"")[0]
            print left_text
            trimfile.write(left_text.strip()+'\n')
            counter = counter + 1

  #      print bitaddress
        trimfile.close() 
searchfile.close
deonbell is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote