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

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...
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.
Please Use JavaScript and HTML 5) Number guesser (easier) Create a number guessing name, using an...
Please Use JavaScript and HTML 5) Number guesser (easier) Create a number guessing name, using an input and a button to gather a number. The number to be guessed should be a hard-coded whole number between 1 and 20. Tell the user if the number is too high, equal to, or too low than a number you have hard-coded in your application. Remove the text in the input when the user clicks the button.
For this assignment, you will write a tic-tac-toe application in HTML and JavaScript, using an HTML...
For this assignment, you will write a tic-tac-toe application in HTML and JavaScript, using an HTML <canvas> tag. The game will be played "hot seat" where players take turns using the same device. Requirements: The canvas should be 600px tall and wide, with the gameplay area occupying most of the canvas. The X's and O's may be drawn using polygons or large-font text The grid should be drawn using polygons, specifically long, thin rectangles Before & between games, the canvas...
Develop a personal web page for yourself using HTML, CSS, and Javascript Use the following HTML...
Develop a personal web page for yourself using HTML, CSS, and Javascript Use the following HTML tags to design your webpage: <h1>...</h1>,<h3>...</h3>, <h6>...</h6>, <p>...</p>, <b>...</b>, <i>...</i>, <a>...</a>, <img...>, <table>... </table>, <div>...</div>, <form>...</form>, <input type="text">, and <input type= "submit"> Use an external css to change the default style of your webpage. You must use at least one element selector, one id selector, and one class selector Using text input and submit button, allow the user to change the background color of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT