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 scrapy.item import Item, Field | |
class QuoteItem(Item): | |
quote_content = Field() | |
tags = Field() | |
author_name = Field() | |
author_birthday = Field() | |
author_bornlocation = Field() | |
author_bio = Field() |
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 QuotesSpider(scrapy.Spider): | |
name = "quotes" | |
start_urls = ['http://quotes.toscrape.com'] | |
def parse(self, response): | |
# self.logger.info('hello this is my first spider') | |
quotes = response.css('div.quote') |
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 yield_demo(n): | |
for j in range(n): | |
yield triple(j) | |
print("j is:", j) | |
print("end of yield_demo") | |
def triple(m): | |
print("inside triple call", m) | |
return m*3 |
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 QuotesSpider(scrapy.Spider): | |
name = "quotes" | |
start_urls = ['http://quotes.toscrape.com'] | |
def parse(self, response): | |
self.logger.info('hello this is my first spider') | |
quotes = response.css('div.quote') |
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
> contractInstance = VotingContract.at(deployedContract.address) | |
Contract { | |
_eth: | |
Eth { | |
_requestManager: RequestManager { provider: [HttpProvider], polls: {}, timeout: null }, | |
getBalance: { [Function: send] request: [Function: bound ], call: 'eth_getBalance' }, | |
getStorageAt: { [Function: send] request: [Function: bound ], call: 'eth_getStorageAt' }, | |
getCode: { [Function: send] request: [Function: bound ], call: 'eth_getCode' }, | |
getBlock: { [Function: send] request: [Function: bound ], call: [Function: blockCall] }, | |
getUncle: { [Function: send] request: [Function: bound ], call: [Function: uncleCall] }, |
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
> abiDefinition = JSON.parse(compiledCode.contracts[':Voting'].interface) | |
[ { constant: true, | |
inputs: [ [Object] ], | |
name: 'totalVotesFor', | |
outputs: [ [Object] ], | |
payable: false, | |
stateMutability: 'view', | |
type: 'function' }, | |
{ constant: true, | |
inputs: [ [Object] ], |
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
wifi-roaming-128-4-185-34:chapter1 harrywang$ node | |
> Web3 = require('web3') | |
{ [Function: Web3] | |
providers: | |
{ HttpProvider: [Function: HttpProvider], | |
IpcProvider: [Function: IpcProvider] } } | |
> web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); | |
Web3 { | |
_requestManager: | |
RequestManager { |
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 re | |
import threading | |
import time | |
import unittest | |
from selenium import webdriver | |
from app import create_app | |
# this test case is an example for selenium based test case, not for real use | |
# this is a demo to show login using selenium |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Baker's Bike Shop</title> | |
<link href="https://fonts.googleapis.com/css?family=Abel|Amatic+SC|Raleway:100,200,300,400,500,600,700,800,900" rel="stylesheet"> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<div class="navigation"> |
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
body { | |
background-color: #FFF; | |
margin: 0; | |
padding: 0; | |
} | |
#cover { | |
height: 900px; | |
position: relative; | |
top: -55px; |