Predict the price of an Armadyl Chainskirt.
Below is some python code that reads and displays element data from an html webpage. In this example we pull the price of the item “Armadyl Chainskirt” by copy and pasting its Official Grand Exchange Page.
from requests_html import HTMLSession session = HTMLSession() url_for_item = 'http://services.runescape.com/m=itemdb_oldschool/Armadyl_chainskirt/viewitem?obj=11830' r = session.get(url_for_item) #line 4 needs to be changed to desired item that is being analyzed print("These are anchor links connected to Twisted Bow GE Page:",r.html.links) #price = r.html.find('#<span title=""', first=True) #print(price) about = r.html.find('.grandexchange .stats h3 span ', first=True) final_value = (str(about)).strip("<Element 'span' title=''>") final_value = final_value.replace(',','') print(final_value) # now we will take our value and append it to a .csv database import csv from time import gmtime, strftime datestamp = strftime("%Y-%m-%d %H:%M:%S", gmtime()) fields = [final_value] with open(r'daily_price_of_arma_skirt.csv', 'a') as f: writer = csv.writer(f, delimiter=',') writer.writerow([final_value]+[datestamp]) #so far, we get the price of our item and edit a local csv file with the price and date. #now we will make it so it opens automatically once per day with #Windows Task Scheduler