Visit creditfixings.com
Click on 2023 Auctions. That takes us to
https://www.creditfixings.com/CreditEventAuctions/AuctionByYear.jsp?year=2023
Click on Diamond Sports Group L.L.C.
Click on Diamond Sports Group L.L.C. Auction Results
Click "I Agree"
import pandas as pd
lst = pd.read_html(
"https://www.creditfixings.com/CreditEventAuctions/results.jsp?ticker=DIAMSPO"
)
for data in lst:
print(data.head(3))
Relevant Currency 0 USD Auction Currency Rates Auction Currency Rates.1 0 USD/USD 1.0 Dealer Bid Offer Dealer.1 0 Barclays Bank PLC 1.00 3.00 Barclays Bank PLC 1 BNP Paribas SA 1.00 3.00 BNP Paribas SA 2 Bofa Securities, Inc. 1.25 3.25 Bofa Securities, Inc. Dealer Bid/Offer Size 0 Barclays Bank PLC Offer 15.302 1 BNP Paribas SA Offer 0.000 2 Bofa Securities, Inc. Offer 0.000 0 1 0 Sum of Buy Physical Requests 0.0m 1 Sum of Sell Physical Requests 44.7m 2 Sum of Physical Request Trades 0.0m Dealer Bid Size 0 Bofa Securities, Inc. 2.0* 3.0 1 J.P. Morgan Securities LLC 1.875* 10.0 2 J.P. Morgan Securities LLC 1.75^ 32.7
import requests
session = requests.Session()
url = "https://www.creditfixings.com/CreditEventAuctions/AuctionByYear.jsp?year=2023"
html = session.get(url).text
html
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >\n\n\n\n\n\n\n\n\n\n\n\n<html>\n<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r\n<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">\r\n<!-- Magnolia delivered pages are identified by full URLs proxy passed pages by relative URLs -->\r\n\n<head>\n <title>Year Credit Event Fixing</title>\n\t<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>\r\n<meta content="" name="description"/>\r\n<meta content="" name="keywords"/>\r\n\n\t<link type="text/css" rel="stylesheet"\nhref="/information/affiliations/fixings/css/main.css" />\n<link type="text/css" rel="stylesheet"\nhref="/information/affiliations/fixings/css/richEdit.css" />\n<link type="text/css" rel="stylesheet"\nhref="/information/affiliations/fixings/css/header.css" />\n<link type="text/css" rel="stylesheet"\nhref="/information/affiliations/fixings/css/page_menu.css" />\n<style type="text/css">\n<!-- .style1 {color: #0065FF} .style2 {color: #993333} -->\n</style>\n\t\n</head>\n<body >\n<div id="centerholder">\n\n<div id="header">\n <div id="topleft">\n <a target="_blank" href="http://www.creditex.com"><img alt="Creditex" class="creditex" height="33" width="169" src="/information/affiliations/fixings/img/logo_creditex.gif" /></a>\n </div>\n <div id="topright">\n <a target="_blank" href="http://www.markit.com"><img class="markit" alt="Markit Group Limited" height="50" width="160" src="/information/affiliations/fixings/img/logo_S&P.png" /></a>\n </div>\n</div>\n\n<div id="main">\n\r\n<div id="twocol1">\n <div class="moreoptionsboxpanel">\n <div class="panelHeader" style="padding-top: 11px; height: 25px; font-size: 15px">\n <div class="panelHeaderContent">\n Credit Event Fixings\n </div>\n </div>\n <div class="panelLink">\n \t\t<a class="activelink" href="/CreditEventAuctions/fixings.jsp">\n \t\tHome\n \t\t\t</a>\n\t\t</div>\n <script>\n \tfunction loadFrame(ele){ \t \t\n \t\t\tele.height = (ele.contentWindow.document.body.scrollHeight) + \'px\'; \t\t\t \t\t\t \t\t\t\n \t} \n \t</script> \n\t\t<iframe id="autoHeight" scrolling="no" width="100%" src="/CreditEventAuctions/years.jsp" onload="loadFrame(this);"></iframe>\n <div class="panelHeader" style="height: 25px; padding-top: 10px; font-size: 15px">\n <div class="panelHeaderContent">\n Information\n </div>\n </div>\n <div class="panelLink">\n <a href="/information/affiliations/fixings/about/about.shtml">\n Fixings Services\n </a>\n </div>\n <div class="panelLink">\n <a href="/information/affiliations/fixings/about/creditex.shtml">\n About Creditex\n </a>\n </div>\n <div class="panelLink">\n <a href="/information/affiliations/fixings/about/markit.shtml">\n About Markit\n </a>\n </div>\n </div>\n</div>\n\r\n<div id="twocol2">\n <a href="/CreditEventAuctions/fixings.jsp">\n <img alt="Credit Fixings" height="110" width="798" class="nowrap"\n src="/information/affiliations/fixings/img/banner_ad.jpg"/>\n </a>\n\r\n\n<div class="boxtitle">\n\t\n 2023 Auctions\n</div>\n<div class="boxpanel">\n<p>\nClick a company name to view the details and results for a particular\nCredit Event Fixing.\n</p>\n<p>\n\t\t <p><span class="standalonelink">\n \t\t\t \t<a href="holdings.jsp?auctionId=9175" TARGET="_top">\n \t\tCASINO GUICHARDPERRACHON - 25 September 2023\n \t</a></span></p>\n\t\t <p><span class="standalonelink">\n \t\t\t \t<a href="holdings.jsp?auctionId=9174" TARGET="_top">\n \t\tVue Entmt Intl Ltd (Bucket 1) - 14 September 2023\n \t</a></span></p>\n\t\t <p><span class="standalonelink">\n \t\t\t \t<a href="holdings.jsp?auctionId=9173" TARGET="_top">\n \t\tDIAMOND SPORTS GROUP LLC - 13 April 2023\n \t</a></span></p>\n\n</p>\n\t<div id="footer">\n Data source:\n <a href="http://www.creditex.com" target="_blank">\n Creditex Group Inc.™</a>\n and\n <a href="http://www.markit.com" target="_blank">\n Markit Group Limited™</a>\n . ©\n <script type="text/javascript">\n <!-- tdate = new Date(); document.write(tdate.getFullYear()); //-->\n </script>\n Creditex Group Inc.™ and Markit Group Limited™ ALL DATA \n PROVIDED AS IS, WITH NO WARRANTIES. All rights reserved. Data may not be\n reproduced or redistributed in any form, except as expressly authorized \n by Creditex Group Inc. or Markit Group Limited.\n <script type="text/javascript"\n src="/information/affiliations/fixings/js/leadlander.js">\n </script>\n</div>\n\n</div>\n</body>\n</html>'
from bs4 import BeautifulSoup
soup = BeautifulSoup(html, "html.parser")
soup
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > <html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> <!-- Magnolia delivered pages are identified by full URLs proxy passed pages by relative URLs --> <head> <title>Year Credit Event Fixing</title> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <meta content="" name="description"/> <meta content="" name="keywords"/> <link href="/information/affiliations/fixings/css/main.css" rel="stylesheet" type="text/css"/> <link href="/information/affiliations/fixings/css/richEdit.css" rel="stylesheet" type="text/css"/> <link href="/information/affiliations/fixings/css/header.css" rel="stylesheet" type="text/css"/> <link href="/information/affiliations/fixings/css/page_menu.css" rel="stylesheet" type="text/css"/> <style type="text/css"> <!-- .style1 {color: #0065FF} .style2 {color: #993333} --> </style> </head> <body> <div id="centerholder"> <div id="header"> <div id="topleft"> <a href="http://www.creditex.com" target="_blank"><img alt="Creditex" class="creditex" height="33" src="/information/affiliations/fixings/img/logo_creditex.gif" width="169"/></a> </div> <div id="topright"> <a href="http://www.markit.com" target="_blank"><img alt="Markit Group Limited" class="markit" height="50" src="/information/affiliations/fixings/img/logo_S&P.png" width="160"/></a> </div> </div> <div id="main"> <div id="twocol1"> <div class="moreoptionsboxpanel"> <div class="panelHeader" style="padding-top: 11px; height: 25px; font-size: 15px"> <div class="panelHeaderContent"> Credit Event Fixings </div> </div> <div class="panelLink"> <a class="activelink" href="/CreditEventAuctions/fixings.jsp"> Home </a> </div> <script> function loadFrame(ele){ ele.height = (ele.contentWindow.document.body.scrollHeight) + 'px'; } </script> <iframe id="autoHeight" onload="loadFrame(this);" scrolling="no" src="/CreditEventAuctions/years.jsp" width="100%"></iframe> <div class="panelHeader" style="height: 25px; padding-top: 10px; font-size: 15px"> <div class="panelHeaderContent"> Information </div> </div> <div class="panelLink"> <a href="/information/affiliations/fixings/about/about.shtml"> Fixings Services </a> </div> <div class="panelLink"> <a href="/information/affiliations/fixings/about/creditex.shtml"> About Creditex </a> </div> <div class="panelLink"> <a href="/information/affiliations/fixings/about/markit.shtml"> About Markit </a> </div> </div> </div> <div id="twocol2"> <a href="/CreditEventAuctions/fixings.jsp"> <img alt="Credit Fixings" class="nowrap" height="110" src="/information/affiliations/fixings/img/banner_ad.jpg" width="798"/> </a> <div class="boxtitle"> 2023 Auctions </div> <div class="boxpanel"> <p> Click a company name to view the details and results for a particular Credit Event Fixing. </p> <p> <p><span class="standalonelink"> <a href="holdings.jsp?auctionId=9175" target="_top"> CASINO GUICHARDPERRACHON - 25 September 2023 </a></span></p> <p><span class="standalonelink"> <a href="holdings.jsp?auctionId=9174" target="_top"> Vue Entmt Intl Ltd (Bucket 1) - 14 September 2023 </a></span></p> <p><span class="standalonelink"> <a href="holdings.jsp?auctionId=9173" target="_top"> DIAMOND SPORTS GROUP LLC - 13 April 2023 </a></span></p> </p> <div id="footer"> Data source: <a href="http://www.creditex.com" target="_blank"> Creditex Group Inc.™</a> and <a href="http://www.markit.com" target="_blank"> Markit Group Limited™</a> . © <script type="text/javascript"> <!-- tdate = new Date(); document.write(tdate.getFullYear()); //--> </script> Creditex Group Inc.™ and Markit Group Limited™ ALL DATA PROVIDED AS IS, WITH NO WARRANTIES. All rights reserved. Data may not be reproduced or redistributed in any form, except as expressly authorized by Creditex Group Inc. or Markit Group Limited. <script src="/information/affiliations/fixings/js/leadlander.js" type="text/javascript"> </script> </div> </div> </div></div></div></body> </html></html>
By viewing the source, we can see that the links to the individual auctions contain "holdings.jsp."
anchors = soup.select('a[href^="holdings.jsp"]')
anchors
[<a href="holdings.jsp?auctionId=9175" target="_top"> CASINO GUICHARDPERRACHON - 25 September 2023 </a>, <a href="holdings.jsp?auctionId=9174" target="_top"> Vue Entmt Intl Ltd (Bucket 1) - 14 September 2023 </a>, <a href="holdings.jsp?auctionId=9173" target="_top"> DIAMOND SPORTS GROUP LLC - 13 April 2023 </a>]
anchor = anchors[0]
text = anchor.text.strip()
url = anchor.get("href")
print("text is", text)
print("url is", url)
text is CASINO GUICHARDPERRACHON - 25 September 2023 url is holdings.jsp?auctionId=9175
By viewing the source of one of the holdings pages, we can see that the results of the auction are at the link containing "results.jsp."
url = anchor.get('href')
url = f'https://www.creditfixings.com/CreditEventAuctions/{url}'
html = session.get(url).text
soup = BeautifulSoup(html, "html.parser")
anchors = soup.select('a[href^="results.jsp"]')
anchors
[<a href="results.jsp?ticker=GROUPE">CASINO GUICHARDPERRACHON Auction Results</a>]
anchor = anchors[0]
url = anchor.get('href')
url = f'https://www.creditfixings.com/CreditEventAuctions/{url}'
lst = pd.read_html(url)
for df in lst:
print(df.head(3))
Relevant Currency 0 EUR Dealer Bid Offer \ 0 Barclays Bank PLC 0.50 2.50 1 BNP Paribas 0.25 2.25 2 Citigroup Global Markets Limited 0.75 2.75 Dealer.1 0 Barclays Bank PLC 1 BNP Paribas 2 Citigroup Global Markets Limited Dealer Bid/Offer Size 0 Barclays Bank PLC Offer 0.0 1 BNP Paribas Offer 21.8 2 Citigroup Global Markets Limited Offer 0.0 0 1 0 Sum of Buy Physical Requests 61.0m 1 Sum of Sell Physical Requests 258.3m 2 Sum of Physical Request Trades 61.0m Dealer Bid Size 0 J.P. Morgan Securities PLC 2.625* 50.0 1 J.P. Morgan Securities PLC 1.5* 10.0 2 Goldman Sachs International 1.375* 25.0