I’m diving into web scraping using Beautiful Soup (BS4) to extract GPU prices from Newegg, but as a complete novice, I’m struggling to parse the webpage content into a readable HTML format. When I request the URL, I get a response, but the parsed document doesn’t seem to contain the HTML structure I expected. Specifically, key HTML tags like are missing. I’m still learning, so I appreciate your patience! Below is my code snippet and the unexpected output.
<code>from bs4 import BeautifulSoup
url = "https://www.newegg.com/evga-geforce-rtx-3080-ti-12g-p5-3967-kr/p/N82E16814487547"
result = requests.get(url)
doc = BeautifulSoup(result.text, "html.parser")
<code>from bs4 import BeautifulSoup
import requests
url = "https://www.newegg.com/evga-geforce-rtx-3080-ti-12g-p5-3967-kr/p/N82E16814487547"
result = requests.get(url)
print(result.text)
doc = BeautifulSoup(result.text, "html.parser")
print(doc.prettify())
</code>
from bs4 import BeautifulSoup
import requests
url = "https://www.newegg.com/evga-geforce-rtx-3080-ti-12g-p5-3967-kr/p/N82E16814487547"
result = requests.get(url)
print(result.text)
doc = BeautifulSoup(result.text, "html.parser")
print(doc.prettify())
window.__neweggState__ = {"country":{"name":"United States","alpha2":"us","alpha3":"USA","geoLocation":"North America","currency":"USD"},"user":{"nvtc":"string","contactWith":"string","loginName":"string","accessToken":"string","lastVisitTime":1,"loginId":"string","isEggExpert":true,"loginToken":"string","isPremier":true,"isLogin":true},"domains":{"WWW":"www.newegg.com","SSL":"secure.newegg.com","MOBILESSL":"secure.m.newegg.com","COM":"www.newegg.com","SecureCOM":"secure.newegg.com","CA":"www.newegg.ca","Dynamic":"newegg.com"},"currency":{"extraUnit":"","currencyCode":"USD","countryCode":"USA","unit":"$","decimalDigits":2,"groupSizes":3,"decimalSeparator":".","groupSeparator":",","positivePattern":0,"supportDecimal":true}}
window.__pageInfo__ = {"params":{"keyword":"evga-geforce-rtx-3080-ti-12g-p5-3967-kr","parentItem":"N82E16814487547"},"query":{},"routeName":"Product","isWWWDomain":true,"imageName":"product","hostname":"www.newegg.com","theme":null}
window.__langResouce__ = {}
<iframe id="cross_storage_www" src="https://www.newegg.com/api/storageHub" style="display:none">
<iframe id="cross_storage_ssl" src="https://secure.newegg.com/api/storageHub" style="display:none">
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/vendor~product~ProductDetail-d142e22f.js">
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/common~product~ProductDetail-8045cd77.js">
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/ProductDetail-49788263.js">
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/adapterScript~product~ProductDetail-da6079e7.js">
<script async="" src="/KruBgE-3DRVqkyI6KQ/Szar2mwiL5/d04wdQ/LXxv/BQQHGDQ?v=035da9ea-c84c-3b78-e5b9-908bca3517dc" type="text/javascript">
<code>output:
</script>
<script defer="">
window.__neweggState__ = {"country":{"name":"United States","alpha2":"us","alpha3":"USA","geoLocation":"North America","currency":"USD"},"user":{"nvtc":"string","contactWith":"string","loginName":"string","accessToken":"string","lastVisitTime":1,"loginId":"string","isEggExpert":true,"loginToken":"string","isPremier":true,"isLogin":true},"domains":{"WWW":"www.newegg.com","SSL":"secure.newegg.com","MOBILESSL":"secure.m.newegg.com","COM":"www.newegg.com","SecureCOM":"secure.newegg.com","CA":"www.newegg.ca","Dynamic":"newegg.com"},"currency":{"extraUnit":"","currencyCode":"USD","countryCode":"USA","unit":"$","decimalDigits":2,"groupSizes":3,"decimalSeparator":".","groupSeparator":",","positivePattern":0,"supportDecimal":true}}
</script>
<script defer="">
window.__pageInfo__ = {"params":{"keyword":"evga-geforce-rtx-3080-ti-12g-p5-3967-kr","parentItem":"N82E16814487547"},"query":{},"routeName":"Product","isWWWDomain":true,"imageName":"product","hostname":"www.newegg.com","theme":null}
</script>
<script defer="">
window.__langResouce__ = {}
</script>
<iframe id="cross_storage_www" src="https://www.newegg.com/api/storageHub" style="display:none">
</iframe>
<iframe id="cross_storage_ssl" src="https://secure.newegg.com/api/storageHub" style="display:none">
</iframe>
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/vendor~product~ProductDetail-d142e22f.js">
</script>
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/common~product~ProductDetail-8045cd77.js">
</script>
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/ProductDetail-49788263.js">
</script>
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/adapterScript~product~ProductDetail-da6079e7.js">
</script>
<script async="" src="/KruBgE-3DRVqkyI6KQ/Szar2mwiL5/d04wdQ/LXxv/BQQHGDQ?v=035da9ea-c84c-3b78-e5b9-908bca3517dc" type="text/javascript">
</script>
</body>
</html>
</code>
output:
</script>
<script defer="">
window.__neweggState__ = {"country":{"name":"United States","alpha2":"us","alpha3":"USA","geoLocation":"North America","currency":"USD"},"user":{"nvtc":"string","contactWith":"string","loginName":"string","accessToken":"string","lastVisitTime":1,"loginId":"string","isEggExpert":true,"loginToken":"string","isPremier":true,"isLogin":true},"domains":{"WWW":"www.newegg.com","SSL":"secure.newegg.com","MOBILESSL":"secure.m.newegg.com","COM":"www.newegg.com","SecureCOM":"secure.newegg.com","CA":"www.newegg.ca","Dynamic":"newegg.com"},"currency":{"extraUnit":"","currencyCode":"USD","countryCode":"USA","unit":"$","decimalDigits":2,"groupSizes":3,"decimalSeparator":".","groupSeparator":",","positivePattern":0,"supportDecimal":true}}
</script>
<script defer="">
window.__pageInfo__ = {"params":{"keyword":"evga-geforce-rtx-3080-ti-12g-p5-3967-kr","parentItem":"N82E16814487547"},"query":{},"routeName":"Product","isWWWDomain":true,"imageName":"product","hostname":"www.newegg.com","theme":null}
</script>
<script defer="">
window.__langResouce__ = {}
</script>
<iframe id="cross_storage_www" src="https://www.newegg.com/api/storageHub" style="display:none">
</iframe>
<iframe id="cross_storage_ssl" src="https://secure.newegg.com/api/storageHub" style="display:none">
</iframe>
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/vendor~product~ProductDetail-d142e22f.js">
</script>
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/common~product~ProductDetail-8045cd77.js">
</script>
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/ProductDetail-49788263.js">
</script>
<script defer="" src="https://c1.neweggimages.com/WebResource/Scripts/WWW/adapterScript~product~ProductDetail-da6079e7.js">
</script>
<script async="" src="/KruBgE-3DRVqkyI6KQ/Szar2mwiL5/d04wdQ/LXxv/BQQHGDQ?v=035da9ea-c84c-3b78-e5b9-908bca3517dc" type="text/javascript">
</script>
</body>
</html>