This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scrapy | |
class CoinSpider(scrapy.Spider): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scrapy | |
class CoinSpider(scrapy.Spider): | |
name = "coin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scrapy | |
class CoinSpider(scrapy.Spider): | |
name = "coin" | |
def start_requests(self): | |
url = "https://coinmarketcap.com/all/views/all/" | |
yield scrapy.Request(url=url, callback=self.parse) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def parse(self, response): | |
for row in response.css("tbody tr"): | |
yield { | |
"name": row.css("a.currency-name-container::text").extract_first(), | |
"symbol": row.css("td.col-symbol::text").extract_first(), | |
"market_cap": row.css("td.market-cap::text").extract_first(), | |
"price": row.css("a.price::attr(data-usd)").extract_first(), | |
"circulating_supply": row.css("td.circulating-supply span::attr(data-supply)").extract_first(), | |
"volume": row.css("a.volume::attr(data-usd)").extract_first() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scrapy | |
class CoinSpider(scrapy.Spider): | |
name = "coin" | |
def start_requests(self): | |
url = "https://coinmarketcap.com/all/views/all/" | |
yield scrapy.Request(url=url, callback=self.parse) | |
def parse(self, response): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tr id="id-bitcoin" class="odd" role="row"> | |
<td class="text-center"> | |
1 | |
</td> | |
<td class="no-wrap currency-name" data-sort="Bitcoin"> | |
<div class="s-s-1 logo-sprite"></div> | |
<span class="currency-symbol visible-xs"><a class="link-secondary" href="/currencies/bitcoin/">BTC</a></span> | |
<br class="visible-xs"> | |
<a class="currency-name-container link-secondary" href="/currencies/bitcoin/">Bitcoin</a> | |
</td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scrapy | |
class CoinSpider(scrapy.Spider): | |
name = "coin" | |
def start_requests(self): | |
url = "https://coinmarketcap.com/all/views/all/" | |
yield scrapy.Request(url=url, callback=self.parse) | |
def parse(self, response): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{"name": "Bitcoin", "symbol": "BTC", "market_cap": "\n$111,793,976,147\n", "price": "6489.45341094", "circulating_supply": "17227025.0", "volume": "3643933075.18"}, | |
{"name": "Ethereum", "symbol": "ETH", "market_cap": "\n$28,021,091,521\n", "price": "276.039836485", "circulating_supply": "101511042.311", "volume": "1356884351.47"}, | |
{"name": "XRP", "symbol": "XRP", "market_cap": "\n$12,774,073,210\n", "price": "0.323193723266", "circulating_supply": "39524508956.0", "volume": "221046052.002"}, | |
{"name": "Bitcoin Cash", "symbol": "BCH", "market_cap": "\n$9,107,466,682\n", "price": "526.167151135", "circulating_supply": "17309075.0", "volume": "291574904.596"}, | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
class InstagramBot(): | |
def __init__(self, email, password): | |
self.browser = webdriver.Chrome() | |
self.email = email | |
self.password = password | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
emailInput = self.browser.find_elements_by_css_selector('form input')[0] | |
passwordInput = self.browser.find_elements_by_css_selector('form input')[1] |
OlderNewer