web scrape forex live prices
table = soup.find('table', class_='calendar__table')
web scrape forex live prices
table = soup.find('table', class_='calendar__table')
web scrape forex live prices
links.append(url + "#detail=" + row['data-eventid'])
web scrape forex live prices
import pandas as pd
import time
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
url = 'https://www.forexfactory.com/calendar.php?month=last'
response = requests.get(url)
data = response.text
soup = BeautifulSoup(data, 'lxml')
web scrape forex live prices
list_of_rows = []
links = []
#Filtering events that have a href link
for row in table.find_all('tr', {'data-eventid':True}):
list_of_cells = []
#Filtering high-impact events
for span in row.find_all('span', class_='high'):
links.append(url + "#detail=" + row['data-eventid'])
#Extracting the values from the table data in each table row
for cell in row.find_all('td', class_=[
'calendar__cell calendar__currency currency',
'calendar__cell calendar__event event',
'calendar__cell calendar__actual actual',
'calendar__cell calendar__forecast forecast',
'calendar__cell calendar__previous previous']):
list_of_cells.append(cell.text)
list_of_rows.append(list_of_cells)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us