Question

In: Computer Science

Using HTML/Javascript (if needed) I want to create a table for a website that pulls data...

Using HTML/Javascript (if needed) I want to create a table for a website that pulls data from another website where the data is being updated on. Example: https://investors.coca-colacompany.com/stock-information/historical-data

I cannot just put in the numbers to a table as they will be getting updated daily. So it needs to link the the website elements.

DATE OPEN HIGH LOW CLOSE VWAP VOLUME % CHG CHANGE TRADE VAL TOTAL TRADES
2020-10-13 -- -- -- 51.09 -- -- 0.00% -- -- --
2020-10-12 50.84 51.525 50.83 51.09 51.155 11.39m 0.55% 0.28 582,437,982.00 70,341
2020-10-09 50.67 51.23 50.60 50.81 50.874 11.41m 0.69% 0.35 580,070,644.00 80,826

Table from:

https://investors.coca-colacompany.com/stock-information/historical-data

Solutions

Expert Solution

from urllib.request import urlopen
from bs4 import BeautifulSoup
import pandas as pd
def scrap():
        html = urlopen("https://investors.coca-colacompany.com/stock-information/historical-data").read()
        soup = BeautifulSoup(html, 'lxml')
        table = soup.find('table',{"class":"qmod-table qmod-table-hover qmod-pricehistory-table nowrap dataTable no-footer dtr-column collapsed"})
        price = []
        
        rows = table.find_all('tr')

        for row in range(len(rows)):
                price_row = []
                columns = rows[row].findAll('td')
                for column in columns: 
                        price_row.append(column.getText())
                price.append(team_row)
    
    return price
                                
                        
if __name__ == "__main__":
        price_matrix = scrap()
    ## Use the price matrix according to your suitability

Please find the above code for the approach, if found any issues please comment, it will be resolved as soon as possible.


Related Solutions

Task 1: HTML and CSS Create a website using HTML5 and CSS3 only. Please no JavaScript...
Task 1: HTML and CSS Create a website using HTML5 and CSS3 only. Please no JavaScript or Bootstrap. Website theme can be anything you want: a country, a town, a place, a hobby, people (yourself, your family...), pets, flowers, food, or anything that you find interesting or useful. It may be about real people/places/things or fictitious. Part 1: Content (HTML) After you decide the theme of your website, create HTML pages with the content you want to present. Remember to...
The code to create a Search/Filter Data with Javascript or html from html page.
The code to create a Search/Filter Data with Javascript or html from html page.
I want to create a d3 map visualization with timeseries data which pulls data from a...
I want to create a d3 map visualization with timeseries data which pulls data from a mysql table. The map will change data every second which would jump from data which contain x datetime to data which contain x+1 datetime (for example January 1 data to January 2). How can I do this? I already know how to set up a Flask API using Python which connects my visual to the database. I just need the SQL Query to change...
For this assignment you need to create a ToDo list using Javascript, along with HTML and...
For this assignment you need to create a ToDo list using Javascript, along with HTML and CSS. Begin by creating a HTML page called todo.html. Then create a Javascript file called todo.js and link it in to the HTML page using a script tag. All Javascript for the assignment must be in the separate file. (For CSS, feel free to include styles in a style block at the top of the HTML page, or to link in CSS from a...
For this assignment you need to create a ToDo list using Javascript, along with HTML and...
For this assignment you need to create a ToDo list using Javascript, along with HTML and CSS. Begin by creating a HTML page called todo.html. Then create a Javascript file called todo.js and link it in to the HTML page using a script tag. All Javascript for the assignment must be in the separate file. (For CSS, feel free to include styles in a style block at the top of the HTML page, or to link in CSS from a...
For this assignment you need to create a ToDo list using Javascript, along with HTML and...
For this assignment you need to create a ToDo list using Javascript, along with HTML and CSS. Begin by creating a HTML page called todo.html. Then create a Javascript file called todo.js and link it in to the HTML page using a script tag. All Javascript for the assignment must be in the separate file. (For CSS, feel free to include styles in a style block at the top of the HTML page, or to link in CSS from a...
Using HTML and JAVASCRIPT Create a Content area on the main entry page will include inputs...
Using HTML and JAVASCRIPT Create a Content area on the main entry page will include inputs for customer entry for the following: Entry field (with labeling) for the Customer's name Entry field (with labeling) for the Customer's email address Entry field (with labeling) for which room the customer is planning on painting Entry field (with labeling) for the width of the room Entry field (with labeling) for the length of the room Entry field (with labeling) using a colour box...
Task 1: HTML and CSS Create a website using HTML5 and CSS3 only. Website theme can...
Task 1: HTML and CSS Create a website using HTML5 and CSS3 only. Website theme can be anything you want: a country, a town, a place, a hobby, people (yourself, your family...), pets, flowers, food, or anything that you find interesting or useful. It may be about real people/places/things or fictitious. Part 1: Content (HTML) After you decide the theme of your website, create HTML pages with the content you want to present. Remember to separate content from presentation. The...
JS Bin / Tax Calculator / using HTML | CSS | JavaScript ------------------------------------------------------------------------------------------- How can I...
JS Bin / Tax Calculator / using HTML | CSS | JavaScript ------------------------------------------------------------------------------------------- How can I edit the JavaScript below so that when the calculate button is clicked the total price only shows two decimal places by using the toFixed() method? ----------------------------------------------------------------------------------------------------------- JavaScript: // Variables var tax = "tax"; // Tax percentage var taxRate = document.getElementById('tax'); // Selecting tax element // On the time of loading the DOM we are setting the tax rate window.addEventListener('DOMContentLoaded', (event) => { taxRate.value =...
Hi there, I have needed a big report about "Personal Portfolio Website" Which is included (HTML,...
Hi there, I have needed a big report about "Personal Portfolio Website" Which is included (HTML, CSS, JavaScript). You have to write briefly about HTML, CSS, JAVASCRIPT And Portfolio Website. Please try to write at least 5000 (Five Thousand) words. Thanks in Advanced.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT