Skip to content

Instantly share code, notes, and snippets.

@armindocachada
Created March 29, 2021 21:44
Show Gist options
  • Save armindocachada/0cbdf33268a831c45daeeb33cefeca28 to your computer and use it in GitHub Desktop.
Save armindocachada/0cbdf33268a831c45daeeb33cefeca28 to your computer and use it in GitHub Desktop.
Python notebook for YouTube Video: Web Scraping with Python, Selenium and BeautifulSoup for RTX 3060 Ebay sold prices - https://www.youtube.com/watch?v=zpBIJLdODks
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"from selenium import webdriver as wd\n",
"import chromedriver_binary"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"wd = wd.Chrome()\n",
"wd.implicitly_wait(10)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"url=\"https://www.ebay.com/sch/i.html?_from=R40&_nkw=rtx+3060&_sacat=0&LH_Sold=1&LH_Complete=1&rt=nc&Memory%2520Size=12%2520GB&_dcat=27386\""
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"wd.get(url)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"wd.find_element_by_id(\"gdpr-banner-accept\").click()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"page_source = wd.page_source"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"from bs4 import BeautifulSoup\n",
"soup = BeautifulSoup(wd.page_source)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'Sold listingsRemove filter12 GBRemove filterClear AllFilters7MSHold 5 Ma0r 4,BO 20GB0921Sold ItemEVGA GeForce RTX 3060 XC Gaming 12 Gb GPUBrand New · EVGA · 12 GB$752.00Mar-4 12:1010 bidsFrom United StatesShipping not specifiedBenefits charityView similar active itemsSell one like thisSold0UC MMar 4, S2202QSD11Sold ItemNew ListingGIGABYTE GeForce RTX 3060 EAGLE OC 12GB GDDR6 Graphics CardBrand New · GIGABYTE · 12 GB1.0 out of 5 stars.1 product rating - GIGABYTE GeForce RTX 3060 EAGLE OC 12GB GDDR6 Graphics Card$899.00Mar-4 12:08or Best OfferFrom United StatesShipping not specifiedView similar active itemsSell one like thisSol6d RMEaFr 4,T4B4 PT2A021Sold ItemNew ListingEVGA GeForce RTX 3060 XC GAMING - Model 12G-P5-3657-KR - IN HAND - SHIPS TODAYBrand New · EVGA · 12 GB$765.00Mar-4 11:44Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like thisPASVolJdAIW 7MGa1r 4, 2021Sold ItemMSI NVIDIA GeForce RTX 3060 Gaming X Dual-Fan 12GB GDDR6 PCIe 4.0 Graphics CardBrand New · MSI · 12 GB$752.00Mar-4 11:4015 bidsFrom United StatesShipping not specifiedView similar active itemsSell one like thisS4VSoVJl9Cd 19W MCar 4, 2021Sold ItemASUS NVIDIA GeForce RTX 3060 TUF Gaming OC Triple-Fan 12GBBrand New · ASUS · 12 GB$860.00Mar-4 11:4026 bidsFrom United States+$21.00 shippingView similar active itemsSell one like thisWS8old1 THWOMaJrX 4, P2021Sold ItemASUS TUF GAMING NVIDIA GEFORCE RTX 3060 OC 12GB\\xa0Brand New · ASUS · 12 GB$811.00Mar-4 11:3724 bidsFrom United StatesShipping not specifiedView similar active itemsSell one like this0SDold VMaSrO 74, ZQCW22021Sold ItemNew ListingZOTAC Gaming GeForce RTX 3060 Twin Edge 12GB GDDR6 ZT-A30600E-10M FREE SHIPPINGBrand New · ZOTAC · 12 GB$779.00Mar-4 11:30or Best OfferFrom United StatesShipping not specifiedView similar active itemsSell one like thisSolY3Ud YLF M3ar J4,9 20T21Sold ItemASUS ROG Strix RTX3060 Overclocked 12GB Gaming GPU *New In Box*Brand New · ASUS · 12 GB$870.00Mar-4 11:2323 bidsFrom United StatesShipping not specifiedView similar active itemsSell one like thisSold9W MOar 4,A 2RK40Q251PMSold ItemZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12GB GDDR6 Graphics CardBrand New · ZOTAC · 12 GB3.0 out of 5 stars.5 product ratings - ZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12GB GDDR6 Graphics Card$825.00Mar-4 11:19Trending at $1,100.00Trending price is based on prices over last 90 days.From United StatesBuy It NowShipping not specifiedView similar active itemsSell one like thisSolIdU M234CHaQMTHr 4, 2021Sold ItemNew ListingGIGABYTE GeForce RTX 3060 Eagle 12GB GDDR6 Graphics Card *Sealed* *In Hand*Brand New · GIGABYTE · 12 GB$750.00Mar-4 11:09or Best OfferFrom United StatesShipping not specifiedView similar active itemsSell one like this7SHoPl3LWEdVP Mar 4, 2021Sold ItemASUS TUF RTX 3060 OC 12GB (NEW IN BOX FACTORY SEALED)Brand New · ASUS · 12 GB$690.00Mar-4 11:0721 bidsFrom United StatesShipping not specifiedView similar active itemsSell one like this2ZT9SoldT W MaZ7r A43, 20Y21Sold ItemEVGA GeForce RTX 3060 XC GAMING, 12GB GDDR6 (SHIPS SAME DAY 🔥)Brand New · EVGA · 12 GB$760.00Mar-4 11:0332 bidsFrom United States+$37.34 shipping estimateCustoms services and international tracking providedView similar active itemsSell one like thisNHSoOVPTLlJd TXMQar 4, 2021Sold ItemZOTAC NVIDIA GeForce RTX 3060 Twin Edge OC 12GBBrand New · ZOTAC · 12 GB3.0 out of 5 stars.5 product ratings - ZOTAC NVIDIA GeForce RTX 3060 Twin Edge OC 12GB$680.00Mar-4 10:131 bidFrom United StatesShipping not specifiedView similar active itemsSell one like thisSSolEd6 8AQ Z81Mar9 4, 2021Sold ItemASUS ROG STRIX GeForce RTX 3060 OC 12GB GDDR6 Graphics Card *Fast Shipping*\\xa0Brand New · ASUS · 12 GB5.0 out of 5 stars.2 product ratings - ASUS ROG STRIX GeForce RTX 3060 OC 12GB GDDR6 Graphics Card *Fast Shipping*\\xa0$830.00Mar-4 10:1115 bidsFrom United StatesShipping not specifiedView similar active itemsSell one like thisL24SXS1IolRd MMarF N4, 2021Sold ItemNVIDIA Geforce RTX 3060 XC 12GB Graphics CardBrand New · EVGA · 12 GB$730.00Mar-4 10:0324 bidsFrom United StatesShipping not specifiedView similar active itemsSell one like thisSo01l2d DMPLA5E2YaRr 4, 2021Sold ItemASUS TUF Gaming GeForce RTX 3060 OC 12GBPre-Owned · ASUS · 12 GB$780.00Mar-4 08:5030 bidsFrom United States+$41.04 shipping estimateCustoms services and international tracking providedView similar active itemsSell one like thisGSFo9ld MaX6r4 EV4, 5202T1Sold ItemGIGABYTE GeForce RTX 3060 GAMING OC 12G Graphics Card 3 WINDFORCE Fans12GB - NEWBrand New · GIGABYTE · 12 GB$818.99Mar-4 08:46Buy It NowFrom United States+$52.18 shipping estimateCustoms services and international tracking providedView similar active itemsSell one like thisSoRld H30AMMar4 4,5S 2P021SSold ItemNew ListingASUS GeForce RTX 3060 TUF OC 12GB GDDR6 Graphics Card IN HANDBrand New · ASUS · 12 GB$875.00Mar-4 08:46or Best OfferFrom United States+$32.34 shipping estimateCustoms services and international tracking providedView similar active itemsSell one like thisSoCl61Id B MaVrV 74, 20FT21Sold ItemNew ListingASUS ROG STRIX Nvidia GeForce RTX 3060 OC 12GB GDDR6 Ampere Graphics CardBrand New · ASUS · 12 GB5.0 out of 5 stars.2 product ratings - ASUS ROG STRIX Nvidia GeForce RTX 3060 OC 12GB GDDR6 Ampere Graphics Card$885.00Mar-4 08:29Trending at $1,050.00Trending price is based on prices over last 90 days.From United StatesBuy It NowShipping not specifiedView similar active itemsSell one like thisEWCS5IolPd Z GMaRHrV 4, 2021Sold ItemNew ListingMSI GeForce RTX 3060 Gaming X 12G GPU Brand New Sealed in box, Ships FastBrand New · MSI · 12 GB$849.00Mar-4 07:59or Best OfferFrom United States+$30.54 shipping estimateCustoms services and international tracking providedView similar active itemsSell one like thisSold UM0ar 4R, 6JXU2U021V4Sold ItemNVIDIA Geforce RTX 3060 12GBGB Graphics CardBrand New · Geforce · 12 GB$787.00Mar-4 07:252 bidsFrom United StatesShipping not specifiedView similar active itemsSell one like this1CUSoBldS BP Mar 4H4IF, 2021Sold ItemNew ListingGraphics Card RTX 3060 TWIN EDGE 12 GBBrand New · 12 GB$580.00Mar-4 06:57Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like thisSoJRldG L M7GQXar 4YZ, 2021Sold ItemNew ListingZOTAC RTX 3060 TWIN EDGE OC 12GBBrand New · ZOTAC · 12 GB$560.00Mar-4 06:46Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like thisSoEFlZLRVdJ BMa3r G4, K2021Sold ItemNew ListingEVGA GeForce RTX 3060 XC BLACK 12GB GDDR6 - Nvidia - Video Card - 12G-P5-3655-KRBrand New · EVGA · 12 GB$795.00Mar-4 06:26Buy It NowFrom United States+$31.84 shipping estimateCustoms services and international tracking providedView similar active itemsSell one like this0Sold1GYIG B 2MMar8 4, 2J0721Sold ItemEVGA GeForce RTX 3060 XC Black 12GB GDDR6 Graphics CardBrand New · EVGA · 12 GB4.0 out of 5 stars.5 product ratings - EVGA GeForce RTX 3060 XC Black 12GB GDDR6 Graphics Card$850.00Mar-4 05:09Trending at $1,249.00Trending price is based on prices over last 90 days.From United Statesor Best OfferShipping not specifiedView similar active itemsSell one like thisSLolJdZ M Mar J4,F JPF2021SSold ItemEVGA GeForce RTX 3060 XC GAMING, 12GB GDDR6, Metal Backplate [IN-HAND - TESTED]Open Box · EVGA · 12 GB5.0 out of 5 stars.1 product rating - EVGA GeForce RTX 3060 XC GAMING, 12GB GDDR6, Metal Backplate [IN-HAND - TESTED]$825.00Mar-4 04:441 bidFrom United StatesShipping not specifiedView similar active itemsSell one like thisS2old 0 MZarM 4,Z 208HI2184Sold ItemEVGA GeForce RTX 3060 XC BLACK\\xa012GB GDDR6 Nvidia - 🔥 NEW, SEALED, IN HAND 🔥Brand New · EVGA · 12 GB$899.00Mar-4 01:32Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like thisXZYSoTlEId MAaJArU 4, 2021Sold ItemZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12GB GDDR6 Graphics CardBrand New · ZOTAC · 12 GB3.0 out of 5 stars.5 product ratings - ZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12GB GDDR6 Graphics Card$860.00Mar-4 01:0336 bidsFrom United StatesShipping not specifiedView similar active itemsSell one like thisSo5lHd VMFaBr 649, 2Z021L5LSold ItemNew ListingASUS TUF Gaming Geforce RTX 3060 OC 12GB GDDR6 (Sealed) IN HANDBrand New · ASUS · 12 GB$829.00Mar-4 00:29or Best OfferFrom United StatesShipping not specifiedView similar active itemsSell one like thisSIoClKIdU PMMYa8Sr 4S, 2021Sold ItemNew ListingZOTAC GAMING GeForce RTX 3060 Twin Edge 12GB GDDR6 Graphics Card **IN HAND**Brand New · ZOTAC · 12 GB$725.00Mar-4 00:18Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like thisSo8T70LLld CMKaH74r 3, 2021Sold ItemMSI GeForce RTX 3060 Gaming X 12gbBrand New · MSI · 12 GB$860.00Mar-3 23:3414 bidsFrom United StatesShipping not specifiedView similar active itemsSell one like thisSol5d GCD MMQQar K3,O0T 2021Sold ItemNew ListingEVGA GeForce RTX 3060 XC GAMING, 12G-P5-3657-KR, 12GB GDDR6, Dual-Fan, Metal BacBrand New · EVGA · NVIDIA GeForce RTX 3060 Ti · 8 GB4.0 out of 5 stars.5 product ratings - EVGA GeForce RTX 3060 XC GAMING, 12G-P5-3657-KR, 12GB GDDR6, Dual-Fan, Metal Bac$739.00Mar-3 21:17or Best OfferFrom United StatesShipping not specifiedView similar active itemsSell one like thisBSFo9Tld X3L MaLr 3,0 G20E21Sold ItemNew ListingZOTAC GAMING GeForce RTX 3060 Twin Edge 12GB GDDR6 Graphics Card **IN HAND**Brand New · ZOTAC · 12 GB$789.99Mar-3 20:45Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like this1A3ELUUSoTld YBMYar 3, 2021Sold ItemNew ListingEVGA GeForce RTX 3060 XC BLACK GAMING 12GB GDDR6 Graphics Card **IN HAND**Brand New · EVGA · 12 GB$789.99Mar-3 20:42Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like this0KSNSolJd Mar 3R9,N 2021R4Sold ItemNew ListingNVIDIA EVGA GeForce RTX 3060 12GB XC Graphics CardBrand New · EVGA · NVIDIA GeForce RTX 3060 Ti · 12 GB4.0 out of 5 stars.5 product ratings - NVIDIA EVGA GeForce RTX 3060 12GB XC Graphics Card$800.00Mar-3 20:12or Best OfferFrom United StatesShipping not specifiedView similar active itemsSell one like thisSKV1oFldLA 5MarYWO 3, 2021Sold ItemNew ListingEVGA GeForce RTX 3060 XC GAMING, 12G-P5-3657-KR, 12GB GDDR6, Metal BackplateBrand New · EVGA · 12 GB$798.99Mar-3 20:12Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like thisSAI3CVoldF Mar PU3,0 2M4021Sold ItemNew ListingMSI GeForce RTX 3060 VENTUS 3X OC 12GB GDDR6Brand New · NVIDIA · 12 GB$789.99Mar-3 20:08Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like thisSoFQEXld Ma2r6W 3,P9 2NC021Sold ItemNew ListingEVGA GeForce RTX 3060 XC GAMING 12GB GDDR6 Graphics Card **IN HAND**Brand New · EVGA · 12 GB$799.00Mar-3 19:38Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like thisSSolHd MaO6Zr 3RS, 202O01HSold ItemASUS NVIDIA GeForce RTX 3060 TUF Gaming OC Triple-Fan 12GBBrand New · ASUS · 12 GB$765.00Mar-3 19:2724 bidsFrom United StatesShipping not specifiedView similar active itemsSell one like thisSS8BolTdQ 9AES Ma9r 3, 2021Sold Item*NIB* Nvidia ASUS 3060 TUF 12GB Video Card (TUF-RTX3060-O12G-GAMING)Brand New · ASUS · 12 GB$849.00Mar-3 18:4823 bidsFrom United StatesShipping not specifiedView similar active itemsSell one like thisTSoXldUV MNANTUarC 3, 2021Sold ItemZOTAC RTX 3060 12GB TWIN EDGE OC, BRAND NEW IN BOX, UNOPENED, READY TO SHIPBrand New$871.22Mar-3 18:2938 bidsFrom CanadaShipping not specifiedView similar active itemsSell one like thisSold Y ZM8GaLr B3X,NX1 2021Sold ItemZOTAC RTX 3060 12GB TWIN EDGE OC, BRAND NEW IN BOX, UNOPENED, READY TO SHIPBrand New$674.80Mar-3 18:2745 bidsFrom CanadaShipping not specifiedView similar active itemsSell one like thisSoldY 6Mar P3, 020PP2O1UASold ItemNew ListingNEW IN HAND ZOTAC GAMING GeForce RTX 3060 Twin Edge 12GB GDDR6 Graphics CardBrand New · ZOTAC · 12 GB$774.99Mar-3 18:20or Best OfferFrom United States+$52.07 shipping estimateCustoms services and international tracking providedView similar active itemsSell one like this8SJoldX 4 MarF 3O,0X 2602T1Sold ItemNew ListingZOTAC Gaming GeForce RTX 3060 Twin Edge OC 12GB GDDR6 New SealedBrand New · ZOTAC · 12 GB$779.00Mar-3 17:46Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like this9Sold V7SY 6LMaGr9VD 3, 2021Sold ItemNew ListingASUS TUF Gaming GeForce RTX 3060 OC EDITION 12GB TUF-RTX3060-O12G-GAMING IN HANDBrand New · ASUS · 12 GB$869.69Mar-3 17:18Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like thisS6Told G7Q0 Ma62Hr 39, N2021Sold ItemNew ListingZOTAC Gaming GeForce RTX 3060 Twin Edge OC 12GB FREE & INSUREDBrand New · ZOTAC · 12 GB$779.99Mar-3 17:12Buy It NowFrom United StatesShipping not specifiedView similar active itemsSell one like thisXSold 5DMar 3U,S0 C2021VSold ItemASUS NVIDIA GeForce RTX 3060 OVERCLOCK TRIPLE-FAN 12gb GDDR6. \"New\"Brand New · ASUS · 12 GB$786.00Mar-3 17:06or Best OfferFrom United StatesShipping not specifiedView similar active itemsSell one like thisS3UoTlFd MDCar PFH3, 4E2021Sold ItemNew ListingNEW IN HAND - EVGA GeForce RTX 3060 XC GAMING, 12G-P5-3657-KR, 12GB GDDR6\\xa0Brand New · EVGA · 12 GB$749.00Mar-3 16:42or Best OfferFrom United StatesShipping not specifiedView similar active itemsSell one like this6SoRlSK1d MIaIUr B133, 2021Sold ItemNew ListingEVGA GeForce RTX 3060 XC GAMING 12GB GDDR6 Graphics Card **IN HAND**Brand New · EVGA · 12 GB$799.99Mar-3 16:07Buy It NowFrom United States+$32.53 shipping estimateCustoms services and international tracking providedView similar active itemsSell one like thisENS99ol58GHdC G Mar 3, F2021Sold ItemNew ListingMSI NVIDIA GeForce RTX 3060 Gaming X Overclocked Dual-Fan 12GB GDDR6 - BRAND NEWBrand New · NVIDIA · 12 GB$779.00Mar-3 16:04or Best OfferFrom United StatesShipping not specifiedView similar active itemsSell one like thisTell us what you think - opens in new window or tabResults Pagination - Page 1Results Pagination - Page 11234567Items Per Page5025Items Per Page100Items Per Page200Items Per Page'"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"results = soup.find(\"ul\", {\"class\":\"srp-results\"})\n",
"results.text"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Purchase Date</th>\n",
" <th>Product Title</th>\n",
" <th>Price</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Mar-4 12:10</td>\n",
" <td>EVGA GeForce RTX 3060 XC Gaming 12 Gb GPU</td>\n",
" <td>$752.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Mar-4 12:08</td>\n",
" <td>New ListingGIGABYTE GeForce RTX 3060 EAGLE OC ...</td>\n",
" <td>$899.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Mar-4 11:44</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC GAMING - M...</td>\n",
" <td>$765.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Mar-4 11:40</td>\n",
" <td>MSI NVIDIA GeForce RTX 3060 Gaming X Dual-Fan ...</td>\n",
" <td>$752.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Mar-4 11:40</td>\n",
" <td>ASUS NVIDIA GeForce RTX 3060 TUF Gaming OC Tri...</td>\n",
" <td>$860.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Mar-4 11:37</td>\n",
" <td>ASUS TUF GAMING NVIDIA GEFORCE RTX 3060 OC 12GB</td>\n",
" <td>$811.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Mar-4 11:30</td>\n",
" <td>New ListingZOTAC Gaming GeForce RTX 3060 Twin ...</td>\n",
" <td>$779.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>Mar-4 11:23</td>\n",
" <td>ASUS ROG Strix RTX3060 Overclocked 12GB Gaming...</td>\n",
" <td>$870.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Mar-4 11:19</td>\n",
" <td>ZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12G...</td>\n",
" <td>$825.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>Mar-4 11:09</td>\n",
" <td>New ListingGIGABYTE GeForce RTX 3060 Eagle 12G...</td>\n",
" <td>$750.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>Mar-4 11:07</td>\n",
" <td>ASUS TUF RTX 3060 OC 12GB (NEW IN BOX FACTORY ...</td>\n",
" <td>$690.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>Mar-4 11:03</td>\n",
" <td>EVGA GeForce RTX 3060 XC GAMING, 12GB GDDR6 (S...</td>\n",
" <td>$760.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>Mar-4 10:13</td>\n",
" <td>ZOTAC NVIDIA GeForce RTX 3060 Twin Edge OC 12GB</td>\n",
" <td>$680.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>Mar-4 10:11</td>\n",
" <td>ASUS ROG STRIX GeForce RTX 3060 OC 12GB GDDR6 ...</td>\n",
" <td>$830.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>Mar-4 10:03</td>\n",
" <td>NVIDIA Geforce RTX 3060 XC 12GB Graphics Card</td>\n",
" <td>$730.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>Mar-4 08:50</td>\n",
" <td>ASUS TUF Gaming GeForce RTX 3060 OC 12GB</td>\n",
" <td>$780.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>Mar-4 08:46</td>\n",
" <td>GIGABYTE GeForce RTX 3060 GAMING OC 12G Graphi...</td>\n",
" <td>$818.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>Mar-4 08:46</td>\n",
" <td>New ListingASUS GeForce RTX 3060 TUF OC 12GB G...</td>\n",
" <td>$875.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>Mar-4 08:29</td>\n",
" <td>New ListingASUS ROG STRIX Nvidia GeForce RTX 3...</td>\n",
" <td>$885.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>Mar-4 07:59</td>\n",
" <td>New ListingMSI GeForce RTX 3060 Gaming X 12G G...</td>\n",
" <td>$849.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>Mar-4 07:25</td>\n",
" <td>NVIDIA Geforce RTX 3060 12GBGB Graphics Card</td>\n",
" <td>$787.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>Mar-4 06:57</td>\n",
" <td>New ListingGraphics Card RTX 3060 TWIN EDGE 12 GB</td>\n",
" <td>$580.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>Mar-4 06:46</td>\n",
" <td>New ListingZOTAC RTX 3060 TWIN EDGE OC 12GB</td>\n",
" <td>$560.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>Mar-4 06:26</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC BLACK 12GB...</td>\n",
" <td>$795.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>Mar-4 05:09</td>\n",
" <td>EVGA GeForce RTX 3060 XC Black 12GB GDDR6 Grap...</td>\n",
" <td>$850.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>Mar-4 04:44</td>\n",
" <td>EVGA GeForce RTX 3060 XC GAMING, 12GB GDDR6, M...</td>\n",
" <td>$825.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>Mar-4 01:32</td>\n",
" <td>EVGA GeForce RTX 3060 XC BLACK 12GB GDDR6 Nvid...</td>\n",
" <td>$899.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>Mar-4 01:03</td>\n",
" <td>ZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12G...</td>\n",
" <td>$860.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>Mar-4 00:29</td>\n",
" <td>New ListingASUS TUF Gaming Geforce RTX 3060 OC...</td>\n",
" <td>$829.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>Mar-4 00:18</td>\n",
" <td>New ListingZOTAC GAMING GeForce RTX 3060 Twin ...</td>\n",
" <td>$725.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>Mar-3 23:34</td>\n",
" <td>MSI GeForce RTX 3060 Gaming X 12gb</td>\n",
" <td>$860.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>Mar-3 21:17</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC GAMING, 12...</td>\n",
" <td>$739.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>Mar-3 20:45</td>\n",
" <td>New ListingZOTAC GAMING GeForce RTX 3060 Twin ...</td>\n",
" <td>$789.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>Mar-3 20:42</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC BLACK GAMI...</td>\n",
" <td>$789.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>Mar-3 20:12</td>\n",
" <td>New ListingNVIDIA EVGA GeForce RTX 3060 12GB X...</td>\n",
" <td>$800.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>Mar-3 20:12</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC GAMING, 12...</td>\n",
" <td>$798.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>Mar-3 20:08</td>\n",
" <td>New ListingMSI GeForce RTX 3060 VENTUS 3X OC 1...</td>\n",
" <td>$789.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>Mar-3 19:38</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC GAMING 12G...</td>\n",
" <td>$799.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>38</th>\n",
" <td>Mar-3 19:27</td>\n",
" <td>ASUS NVIDIA GeForce RTX 3060 TUF Gaming OC Tri...</td>\n",
" <td>$765.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>Mar-3 18:48</td>\n",
" <td>*NIB* Nvidia ASUS 3060 TUF 12GB Video Card (TU...</td>\n",
" <td>$849.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>40</th>\n",
" <td>Mar-3 18:29</td>\n",
" <td>ZOTAC RTX 3060 12GB TWIN EDGE OC, BRAND NEW IN...</td>\n",
" <td>$871.22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>41</th>\n",
" <td>Mar-3 18:27</td>\n",
" <td>ZOTAC RTX 3060 12GB TWIN EDGE OC, BRAND NEW IN...</td>\n",
" <td>$674.80</td>\n",
" </tr>\n",
" <tr>\n",
" <th>42</th>\n",
" <td>Mar-3 18:20</td>\n",
" <td>New ListingNEW IN HAND ZOTAC GAMING GeForce RT...</td>\n",
" <td>$774.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>43</th>\n",
" <td>Mar-3 17:46</td>\n",
" <td>New ListingZOTAC Gaming GeForce RTX 3060 Twin ...</td>\n",
" <td>$779.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>44</th>\n",
" <td>Mar-3 17:18</td>\n",
" <td>New ListingASUS TUF Gaming GeForce RTX 3060 OC...</td>\n",
" <td>$869.69</td>\n",
" </tr>\n",
" <tr>\n",
" <th>45</th>\n",
" <td>Mar-3 17:12</td>\n",
" <td>New ListingZOTAC Gaming GeForce RTX 3060 Twin ...</td>\n",
" <td>$779.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>46</th>\n",
" <td>Mar-3 17:06</td>\n",
" <td>ASUS NVIDIA GeForce RTX 3060 OVERCLOCK TRIPLE-...</td>\n",
" <td>$786.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>47</th>\n",
" <td>Mar-3 16:42</td>\n",
" <td>New ListingNEW IN HAND - EVGA GeForce RTX 3060...</td>\n",
" <td>$749.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>48</th>\n",
" <td>Mar-3 16:07</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC GAMING 12G...</td>\n",
" <td>$799.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>49</th>\n",
" <td>Mar-3 16:04</td>\n",
" <td>New ListingMSI NVIDIA GeForce RTX 3060 Gaming ...</td>\n",
" <td>$779.00</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Purchase Date Product Title Price\n",
"0 Mar-4 12:10 EVGA GeForce RTX 3060 XC Gaming 12 Gb GPU $752.00\n",
"1 Mar-4 12:08 New ListingGIGABYTE GeForce RTX 3060 EAGLE OC ... $899.00\n",
"2 Mar-4 11:44 New ListingEVGA GeForce RTX 3060 XC GAMING - M... $765.00\n",
"3 Mar-4 11:40 MSI NVIDIA GeForce RTX 3060 Gaming X Dual-Fan ... $752.00\n",
"4 Mar-4 11:40 ASUS NVIDIA GeForce RTX 3060 TUF Gaming OC Tri... $860.00\n",
"5 Mar-4 11:37 ASUS TUF GAMING NVIDIA GEFORCE RTX 3060 OC 12GB  $811.00\n",
"6 Mar-4 11:30 New ListingZOTAC Gaming GeForce RTX 3060 Twin ... $779.00\n",
"7 Mar-4 11:23 ASUS ROG Strix RTX3060 Overclocked 12GB Gaming... $870.00\n",
"8 Mar-4 11:19 ZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12G... $825.00\n",
"9 Mar-4 11:09 New ListingGIGABYTE GeForce RTX 3060 Eagle 12G... $750.00\n",
"10 Mar-4 11:07 ASUS TUF RTX 3060 OC 12GB (NEW IN BOX FACTORY ... $690.00\n",
"11 Mar-4 11:03 EVGA GeForce RTX 3060 XC GAMING, 12GB GDDR6 (S... $760.00\n",
"12 Mar-4 10:13 ZOTAC NVIDIA GeForce RTX 3060 Twin Edge OC 12GB $680.00\n",
"13 Mar-4 10:11 ASUS ROG STRIX GeForce RTX 3060 OC 12GB GDDR6 ... $830.00\n",
"14 Mar-4 10:03 NVIDIA Geforce RTX 3060 XC 12GB Graphics Card $730.00\n",
"15 Mar-4 08:50 ASUS TUF Gaming GeForce RTX 3060 OC 12GB $780.00\n",
"16 Mar-4 08:46 GIGABYTE GeForce RTX 3060 GAMING OC 12G Graphi... $818.99\n",
"17 Mar-4 08:46 New ListingASUS GeForce RTX 3060 TUF OC 12GB G... $875.00\n",
"18 Mar-4 08:29 New ListingASUS ROG STRIX Nvidia GeForce RTX 3... $885.00\n",
"19 Mar-4 07:59 New ListingMSI GeForce RTX 3060 Gaming X 12G G... $849.00\n",
"20 Mar-4 07:25 NVIDIA Geforce RTX 3060 12GBGB Graphics Card $787.00\n",
"21 Mar-4 06:57 New ListingGraphics Card RTX 3060 TWIN EDGE 12 GB $580.00\n",
"22 Mar-4 06:46 New ListingZOTAC RTX 3060 TWIN EDGE OC 12GB $560.00\n",
"23 Mar-4 06:26 New ListingEVGA GeForce RTX 3060 XC BLACK 12GB... $795.00\n",
"24 Mar-4 05:09 EVGA GeForce RTX 3060 XC Black 12GB GDDR6 Grap... $850.00\n",
"25 Mar-4 04:44 EVGA GeForce RTX 3060 XC GAMING, 12GB GDDR6, M... $825.00\n",
"26 Mar-4 01:32 EVGA GeForce RTX 3060 XC BLACK 12GB GDDR6 Nvid... $899.00\n",
"27 Mar-4 01:03 ZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12G... $860.00\n",
"28 Mar-4 00:29 New ListingASUS TUF Gaming Geforce RTX 3060 OC... $829.00\n",
"29 Mar-4 00:18 New ListingZOTAC GAMING GeForce RTX 3060 Twin ... $725.00\n",
"30 Mar-3 23:34 MSI GeForce RTX 3060 Gaming X 12gb $860.00\n",
"31 Mar-3 21:17 New ListingEVGA GeForce RTX 3060 XC GAMING, 12... $739.00\n",
"32 Mar-3 20:45 New ListingZOTAC GAMING GeForce RTX 3060 Twin ... $789.99\n",
"33 Mar-3 20:42 New ListingEVGA GeForce RTX 3060 XC BLACK GAMI... $789.99\n",
"34 Mar-3 20:12 New ListingNVIDIA EVGA GeForce RTX 3060 12GB X... $800.00\n",
"35 Mar-3 20:12 New ListingEVGA GeForce RTX 3060 XC GAMING, 12... $798.99\n",
"36 Mar-3 20:08 New ListingMSI GeForce RTX 3060 VENTUS 3X OC 1... $789.99\n",
"37 Mar-3 19:38 New ListingEVGA GeForce RTX 3060 XC GAMING 12G... $799.00\n",
"38 Mar-3 19:27 ASUS NVIDIA GeForce RTX 3060 TUF Gaming OC Tri... $765.00\n",
"39 Mar-3 18:48 *NIB* Nvidia ASUS 3060 TUF 12GB Video Card (TU... $849.00\n",
"40 Mar-3 18:29 ZOTAC RTX 3060 12GB TWIN EDGE OC, BRAND NEW IN... $871.22\n",
"41 Mar-3 18:27 ZOTAC RTX 3060 12GB TWIN EDGE OC, BRAND NEW IN... $674.80\n",
"42 Mar-3 18:20 New ListingNEW IN HAND ZOTAC GAMING GeForce RT... $774.99\n",
"43 Mar-3 17:46 New ListingZOTAC Gaming GeForce RTX 3060 Twin ... $779.00\n",
"44 Mar-3 17:18 New ListingASUS TUF Gaming GeForce RTX 3060 OC... $869.69\n",
"45 Mar-3 17:12 New ListingZOTAC Gaming GeForce RTX 3060 Twin ... $779.99\n",
"46 Mar-3 17:06 ASUS NVIDIA GeForce RTX 3060 OVERCLOCK TRIPLE-... $786.00\n",
"47 Mar-3 16:42 New ListingNEW IN HAND - EVGA GeForce RTX 3060... $749.00\n",
"48 Mar-3 16:07 New ListingEVGA GeForce RTX 3060 XC GAMING 12G... $799.99\n",
"49 Mar-3 16:04 New ListingMSI NVIDIA GeForce RTX 3060 Gaming ... $779.00"
]
},
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"items = results.findAll(\"li\", {\"class\":\"s-item\"})\n",
"rows=[]\n",
"for item in items:\n",
" titleElement = item.find(\"h3\",{\"class\":\"s-item__title\"}) \n",
" priceElement = item.find(\"span\",{\"class\":\"s-item__price\"})\n",
" purchaseDateElement = item.find(\"span\", {\"class\":\"s-item__endedDate\"})\n",
" if titleElement and priceElement:\n",
" row=[purchaseDateElement.text, titleElement.text, priceElement.text]\n",
" rows.append(row)\n",
"pd.DataFrame.from_records(rows, columns=[\"Purchase Date\",\"Product Title\",\"Price\"])"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {},
"outputs": [],
"source": [
"def convertResultsPageToPanda(results_page_html):\n",
" soup = BeautifulSoup(results_page_html)\n",
" results = soup.find(\"ul\", {\"class\":\"srp-results\"})\n",
" items = results.findAll(\"li\", {\"class\":\"s-item\"})\n",
" rows=[]\n",
" for item in items:\n",
" titleElement = item.find(\"h3\",{\"class\":\"s-item__title\"}) \n",
" priceElement = item.find(\"span\",{\"class\":\"s-item__price\"})\n",
" purchaseDateElement = item.find(\"span\", {\"class\":\"s-item__endedDate\"})\n",
" if titleElement and priceElement:\n",
" row=[purchaseDateElement.text, titleElement.text, priceElement.text]\n",
" rows.append(row)\n",
" df = pd.DataFrame.from_records(rows, columns=[\"Purchase Date\",\"Product Title\",\"Price\"])\n",
" return df"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Purchase Date</th>\n",
" <th>Product Title</th>\n",
" <th>Price</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Mar-4 12:10</td>\n",
" <td>EVGA GeForce RTX 3060 XC Gaming 12 Gb GPU</td>\n",
" <td>$752.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Mar-4 12:08</td>\n",
" <td>New ListingGIGABYTE GeForce RTX 3060 EAGLE OC ...</td>\n",
" <td>$899.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Mar-4 11:40</td>\n",
" <td>MSI NVIDIA GeForce RTX 3060 Gaming X Dual-Fan ...</td>\n",
" <td>$752.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Mar-4 11:40</td>\n",
" <td>ASUS NVIDIA GeForce RTX 3060 TUF Gaming OC Tri...</td>\n",
" <td>$860.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Mar-4 11:37</td>\n",
" <td>ASUS TUF GAMING NVIDIA GEFORCE RTX 3060 OC 12GB</td>\n",
" <td>$811.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Mar-4 11:30</td>\n",
" <td>New ListingZOTAC Gaming GeForce RTX 3060 Twin ...</td>\n",
" <td>$779.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Mar-4 11:23</td>\n",
" <td>ASUS ROG Strix RTX3060 Overclocked 12GB Gaming...</td>\n",
" <td>$870.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>Mar-4 11:19</td>\n",
" <td>ZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12G...</td>\n",
" <td>$825.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Mar-4 11:09</td>\n",
" <td>New ListingGIGABYTE GeForce RTX 3060 Eagle 12G...</td>\n",
" <td>$750.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>Mar-4 11:07</td>\n",
" <td>ASUS TUF RTX 3060 OC 12GB (NEW IN BOX FACTORY ...</td>\n",
" <td>$690.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>Mar-4 11:03</td>\n",
" <td>EVGA GeForce RTX 3060 XC GAMING, 12GB GDDR6 (S...</td>\n",
" <td>$760.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>Mar-4 10:13</td>\n",
" <td>ZOTAC NVIDIA GeForce RTX 3060 Twin Edge OC 12GB</td>\n",
" <td>$680.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>Mar-4 10:11</td>\n",
" <td>ASUS ROG STRIX GeForce RTX 3060 OC 12GB GDDR6 ...</td>\n",
" <td>$830.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>Mar-4 10:03</td>\n",
" <td>NVIDIA Geforce RTX 3060 XC 12GB Graphics Card</td>\n",
" <td>$730.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>Mar-4 08:50</td>\n",
" <td>ASUS TUF Gaming GeForce RTX 3060 OC 12GB</td>\n",
" <td>$780.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>Mar-4 08:46</td>\n",
" <td>GIGABYTE GeForce RTX 3060 GAMING OC 12G Graphi...</td>\n",
" <td>$818.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>Mar-4 08:46</td>\n",
" <td>New ListingASUS GeForce RTX 3060 TUF OC 12GB G...</td>\n",
" <td>$875.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>Mar-4 08:29</td>\n",
" <td>New ListingASUS ROG STRIX Nvidia GeForce RTX 3...</td>\n",
" <td>$885.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>Mar-4 07:59</td>\n",
" <td>New ListingMSI GeForce RTX 3060 Gaming X 12G G...</td>\n",
" <td>$849.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>Mar-4 07:25</td>\n",
" <td>NVIDIA Geforce RTX 3060 12GBGB Graphics Card</td>\n",
" <td>$787.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>Mar-4 06:57</td>\n",
" <td>New ListingGraphics Card RTX 3060 TWIN EDGE 12 GB</td>\n",
" <td>$580.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>Mar-4 06:46</td>\n",
" <td>New ListingZOTAC RTX 3060 TWIN EDGE OC 12GB</td>\n",
" <td>$560.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>Mar-4 06:26</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC BLACK 12GB...</td>\n",
" <td>$795.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>Mar-4 05:09</td>\n",
" <td>EVGA GeForce RTX 3060 XC Black 12GB GDDR6 Grap...</td>\n",
" <td>$850.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>Mar-4 04:44</td>\n",
" <td>EVGA GeForce RTX 3060 XC GAMING, 12GB GDDR6, M...</td>\n",
" <td>$825.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>Mar-4 01:32</td>\n",
" <td>EVGA GeForce RTX 3060 XC BLACK 12GB GDDR6 Nvid...</td>\n",
" <td>$899.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>Mar-4 01:03</td>\n",
" <td>ZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12G...</td>\n",
" <td>$860.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>Mar-4 00:29</td>\n",
" <td>New ListingASUS TUF Gaming Geforce RTX 3060 OC...</td>\n",
" <td>$829.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>Mar-4 00:18</td>\n",
" <td>New ListingZOTAC GAMING GeForce RTX 3060 Twin ...</td>\n",
" <td>$725.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>Mar-3 23:34</td>\n",
" <td>MSI GeForce RTX 3060 Gaming X 12gb</td>\n",
" <td>$860.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>Mar-3 21:17</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC GAMING, 12...</td>\n",
" <td>$739.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>Mar-3 20:45</td>\n",
" <td>New ListingZOTAC GAMING GeForce RTX 3060 Twin ...</td>\n",
" <td>$789.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>Mar-3 20:42</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC BLACK GAMI...</td>\n",
" <td>$789.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>Mar-3 20:12</td>\n",
" <td>New ListingNVIDIA EVGA GeForce RTX 3060 12GB X...</td>\n",
" <td>$800.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>Mar-3 20:12</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC GAMING, 12...</td>\n",
" <td>$798.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>Mar-3 20:08</td>\n",
" <td>New ListingMSI GeForce RTX 3060 VENTUS 3X OC 1...</td>\n",
" <td>$789.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>Mar-3 19:38</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC GAMING 12G...</td>\n",
" <td>$799.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>Mar-3 19:27</td>\n",
" <td>ASUS NVIDIA GeForce RTX 3060 TUF Gaming OC Tri...</td>\n",
" <td>$765.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>38</th>\n",
" <td>Mar-3 18:48</td>\n",
" <td>*NIB* Nvidia ASUS 3060 TUF 12GB Video Card (TU...</td>\n",
" <td>$849.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>Mar-3 18:29</td>\n",
" <td>ZOTAC RTX 3060 12GB TWIN EDGE OC, BRAND NEW IN...</td>\n",
" <td>$871.22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>40</th>\n",
" <td>Mar-3 18:27</td>\n",
" <td>ZOTAC RTX 3060 12GB TWIN EDGE OC, BRAND NEW IN...</td>\n",
" <td>$674.80</td>\n",
" </tr>\n",
" <tr>\n",
" <th>41</th>\n",
" <td>Mar-3 18:20</td>\n",
" <td>New ListingNEW IN HAND ZOTAC GAMING GeForce RT...</td>\n",
" <td>$774.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>42</th>\n",
" <td>Mar-3 17:46</td>\n",
" <td>New ListingZOTAC Gaming GeForce RTX 3060 Twin ...</td>\n",
" <td>$779.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>43</th>\n",
" <td>Mar-3 17:18</td>\n",
" <td>New ListingASUS TUF Gaming GeForce RTX 3060 OC...</td>\n",
" <td>$869.69</td>\n",
" </tr>\n",
" <tr>\n",
" <th>44</th>\n",
" <td>Mar-3 17:12</td>\n",
" <td>New ListingZOTAC Gaming GeForce RTX 3060 Twin ...</td>\n",
" <td>$779.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>45</th>\n",
" <td>Mar-3 17:06</td>\n",
" <td>ASUS NVIDIA GeForce RTX 3060 OVERCLOCK TRIPLE-...</td>\n",
" <td>$786.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>46</th>\n",
" <td>Mar-3 16:42</td>\n",
" <td>New ListingNEW IN HAND - EVGA GeForce RTX 3060...</td>\n",
" <td>$749.00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>47</th>\n",
" <td>Mar-3 16:07</td>\n",
" <td>New ListingEVGA GeForce RTX 3060 XC GAMING 12G...</td>\n",
" <td>$799.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>48</th>\n",
" <td>Mar-3 16:04</td>\n",
" <td>New ListingMSI NVIDIA GeForce RTX 3060 Gaming ...</td>\n",
" <td>$779.00</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Purchase Date Product Title Price\n",
"0 Mar-4 12:10 EVGA GeForce RTX 3060 XC Gaming 12 Gb GPU $752.00\n",
"1 Mar-4 12:08 New ListingGIGABYTE GeForce RTX 3060 EAGLE OC ... $899.00\n",
"2 Mar-4 11:40 MSI NVIDIA GeForce RTX 3060 Gaming X Dual-Fan ... $752.00\n",
"3 Mar-4 11:40 ASUS NVIDIA GeForce RTX 3060 TUF Gaming OC Tri... $860.00\n",
"4 Mar-4 11:37 ASUS TUF GAMING NVIDIA GEFORCE RTX 3060 OC 12GB  $811.00\n",
"5 Mar-4 11:30 New ListingZOTAC Gaming GeForce RTX 3060 Twin ... $779.00\n",
"6 Mar-4 11:23 ASUS ROG Strix RTX3060 Overclocked 12GB Gaming... $870.00\n",
"7 Mar-4 11:19 ZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12G... $825.00\n",
"8 Mar-4 11:09 New ListingGIGABYTE GeForce RTX 3060 Eagle 12G... $750.00\n",
"9 Mar-4 11:07 ASUS TUF RTX 3060 OC 12GB (NEW IN BOX FACTORY ... $690.00\n",
"10 Mar-4 11:03 EVGA GeForce RTX 3060 XC GAMING, 12GB GDDR6 (S... $760.00\n",
"11 Mar-4 10:13 ZOTAC NVIDIA GeForce RTX 3060 Twin Edge OC 12GB $680.00\n",
"12 Mar-4 10:11 ASUS ROG STRIX GeForce RTX 3060 OC 12GB GDDR6 ... $830.00\n",
"13 Mar-4 10:03 NVIDIA Geforce RTX 3060 XC 12GB Graphics Card $730.00\n",
"14 Mar-4 08:50 ASUS TUF Gaming GeForce RTX 3060 OC 12GB $780.00\n",
"15 Mar-4 08:46 GIGABYTE GeForce RTX 3060 GAMING OC 12G Graphi... $818.99\n",
"16 Mar-4 08:46 New ListingASUS GeForce RTX 3060 TUF OC 12GB G... $875.00\n",
"17 Mar-4 08:29 New ListingASUS ROG STRIX Nvidia GeForce RTX 3... $885.00\n",
"18 Mar-4 07:59 New ListingMSI GeForce RTX 3060 Gaming X 12G G... $849.00\n",
"19 Mar-4 07:25 NVIDIA Geforce RTX 3060 12GBGB Graphics Card $787.00\n",
"20 Mar-4 06:57 New ListingGraphics Card RTX 3060 TWIN EDGE 12 GB $580.00\n",
"21 Mar-4 06:46 New ListingZOTAC RTX 3060 TWIN EDGE OC 12GB $560.00\n",
"22 Mar-4 06:26 New ListingEVGA GeForce RTX 3060 XC BLACK 12GB... $795.00\n",
"23 Mar-4 05:09 EVGA GeForce RTX 3060 XC Black 12GB GDDR6 Grap... $850.00\n",
"24 Mar-4 04:44 EVGA GeForce RTX 3060 XC GAMING, 12GB GDDR6, M... $825.00\n",
"25 Mar-4 01:32 EVGA GeForce RTX 3060 XC BLACK 12GB GDDR6 Nvid... $899.00\n",
"26 Mar-4 01:03 ZOTAC GeForce RTX 3060 Twin Edge OC Gaming 12G... $860.00\n",
"27 Mar-4 00:29 New ListingASUS TUF Gaming Geforce RTX 3060 OC... $829.00\n",
"28 Mar-4 00:18 New ListingZOTAC GAMING GeForce RTX 3060 Twin ... $725.00\n",
"29 Mar-3 23:34 MSI GeForce RTX 3060 Gaming X 12gb $860.00\n",
"30 Mar-3 21:17 New ListingEVGA GeForce RTX 3060 XC GAMING, 12... $739.00\n",
"31 Mar-3 20:45 New ListingZOTAC GAMING GeForce RTX 3060 Twin ... $789.99\n",
"32 Mar-3 20:42 New ListingEVGA GeForce RTX 3060 XC BLACK GAMI... $789.99\n",
"33 Mar-3 20:12 New ListingNVIDIA EVGA GeForce RTX 3060 12GB X... $800.00\n",
"34 Mar-3 20:12 New ListingEVGA GeForce RTX 3060 XC GAMING, 12... $798.99\n",
"35 Mar-3 20:08 New ListingMSI GeForce RTX 3060 VENTUS 3X OC 1... $789.99\n",
"36 Mar-3 19:38 New ListingEVGA GeForce RTX 3060 XC GAMING 12G... $799.00\n",
"37 Mar-3 19:27 ASUS NVIDIA GeForce RTX 3060 TUF Gaming OC Tri... $765.00\n",
"38 Mar-3 18:48 *NIB* Nvidia ASUS 3060 TUF 12GB Video Card (TU... $849.00\n",
"39 Mar-3 18:29 ZOTAC RTX 3060 12GB TWIN EDGE OC, BRAND NEW IN... $871.22\n",
"40 Mar-3 18:27 ZOTAC RTX 3060 12GB TWIN EDGE OC, BRAND NEW IN... $674.80\n",
"41 Mar-3 18:20 New ListingNEW IN HAND ZOTAC GAMING GeForce RT... $774.99\n",
"42 Mar-3 17:46 New ListingZOTAC Gaming GeForce RTX 3060 Twin ... $779.00\n",
"43 Mar-3 17:18 New ListingASUS TUF Gaming GeForce RTX 3060 OC... $869.69\n",
"44 Mar-3 17:12 New ListingZOTAC Gaming GeForce RTX 3060 Twin ... $779.99\n",
"45 Mar-3 17:06 ASUS NVIDIA GeForce RTX 3060 OVERCLOCK TRIPLE-... $786.00\n",
"46 Mar-3 16:42 New ListingNEW IN HAND - EVGA GeForce RTX 3060... $749.00\n",
"47 Mar-3 16:07 New ListingEVGA GeForce RTX 3060 XC GAMING 12G... $799.99\n",
"48 Mar-3 16:04 New ListingMSI NVIDIA GeForce RTX 3060 Gaming ... $779.00"
]
},
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"convertResultsPageToPanda(wd.page_source)"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n",
"Next page available\n"
]
},
{
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-56-cead9175f96e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[0mnextPageElements\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mclick\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 12\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Next page available\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 13\u001b[1;33m \u001b[0mtime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m5\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 14\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 15\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Completed extracting all the pages. Stopping!\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mKeyboardInterrupt\u001b[0m: "
]
}
],
"source": [
"df_total = pd.DataFrame(columns=[\"Purchase Date\", \"Product Title\", \"Price\"])\n",
"import time\n",
"\n",
"while(True): \n",
" page_source = wd.page_source\n",
" df = convertResultsPageToPanda(page_source)\n",
" pd.concat([df_total,df])\n",
" nextPageElements = wd.find_elements_by_class_name(\"pagination__next\")\n",
" \n",
" if (len(nextPageElements)>0 ):\n",
" nextPageElements[0].click()\n",
" print(\"Next page available\")\n",
" time.sleep(5)\n",
" else:\n",
" print(\"Completed extracting all the pages. Stopping!\")\n",
" break"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"\n",
"\n",
"\n",
"df_rtx_3070[\"Purchase Date\"].apply(lambda x: '2020-' + x if x.startswith(\"Dec-\") else '2021-' + x) "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment