I am looking for a better way to scrape the latest exchange rate from https://www.remitly.com/us/en/india
With the current code below I get 16 instances of 'script' and then going through each one of them and looking if they contain the exchange rate is one way to do it. Is there a better way?
The issue here is that I cannot use additional attributes with soup.find_all(). Also the array elements are too large.
# get current exchange rate
import bs4 as bs
import urllib.request
import parser
from pprint import pprint
source = urllib.request.urlopen('https://www.remitly.com/us/en/india')
soup = bs.BeautifulSoup(source,'lxml')
#js_test = soup.findAll('td', class_='f1smo2ix')
cost = soup.find_all('script')
print(cost)
print(len(cost))