本文整理汇总了Python中scraper.Scraper.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Scraper.__init__方法的具体用法?Python Scraper.__init__怎么用?Python Scraper.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scraper.Scraper
的用法示例。
在下文中一共展示了Scraper.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from scraper import Scraper [as 别名]
# 或者: from scraper.Scraper import __init__ [as 别名]
def __init__(self, base_url = awards_base_url, search_url = ""):
Scraper.__init__(self, base_url, search_url)
self.file = open('academy_awards.csv', 'wb')
self.writer = csv.writer(self.file, delimiter='\t')
self.writer.writerow(['Year', 'Category', 'Won', 'FilmName', 'ActorDirectorName'])
self.soup = self.connect(base_url)
self.next_record = '1'
示例2: __init__
# 需要导入模块: from scraper import Scraper [as 别名]
# 或者: from scraper.Scraper import __init__ [as 别名]
def __init__(self):
Scraper.__init__(self)
api_key = self.config["youtube"]["api_key"]
self.url = "https://www.googleapis.com/youtube/v3/search"
self.params = {
"order": "date",
"maxResults": 10,
"channelId": "UCH1dpzjCEiGAt8CXkryhkZg",
"key": api_key,
"type": "upload",
"part": "snippet"
}
示例3: __init__
# 需要导入模块: from scraper import Scraper [as 别名]
# 或者: from scraper.Scraper import __init__ [as 别名]
def __init__(self):
Scraper.__init__(self)
self.url = "https://go.berniesanders.com/page/event/search_results"
self.html = HTMLParser()
self.params = {
'orderby': 'zip_radius',
'zip_radius[1]': '6000',
'zip_radius[0]': '78218',
'radius_unit': 'mi',
'country': 'US',
'format': 'json'
}
self.map = {
"id": "original_id",
"start_dt": "start_time"
}
示例4: __init__
# 需要导入模块: from scraper import Scraper [as 别名]
# 或者: from scraper.Scraper import __init__ [as 别名]
def __init__(self):
Scraper.__init__(self)
c = self.config["bsd"]
self.html = HTMLParser()
self.call_path = "/page/api/event/search_events"
self.params = {
"api_ver": "2",
"api_id": c["api_id"],
"api_ts": str(int(time.time()))
}
self.signed_params = self.sign_params(c["api_secret"])
self.url = "".join([
c["endpoint"],
self.call_path,
"?",
self.signed_params
])
self.map = {
"event_id": "original_id",
"start_dt": "start_time"
}
示例5: __init__
# 需要导入模块: from scraper import Scraper [as 别名]
# 或者: from scraper.Scraper import __init__ [as 别名]
def __init__(self):
Scraper.__init__(self)
self.root = 'http://bitsnoop.com'
self.site = "bitsnoop.com"
示例6: __init__
# 需要导入模块: from scraper import Scraper [as 别名]
# 或者: from scraper.Scraper import __init__ [as 别名]
def __init__(self):
Scraper.__init__(self)
self.url = "https://berniesanders.com/issues/feed/"
self.html = HTMLParser()
示例7: __init__
# 需要导入模块: from scraper import Scraper [as 别名]
# 或者: from scraper.Scraper import __init__ [as 别名]
def __init__(self, *args, **kwargs):
Scraper.__init__(self, *args, **kwargs)
self.shopify_app_handle = kwargs.get("shopify_app_handle", None)
self.shopify_app_url = kwargs.get("shopify_app_url", None)
self.tloc = threading.local()
self.shop_urls = []
示例8: __init__
# 需要导入模块: from scraper import Scraper [as 别名]
# 或者: from scraper.Scraper import __init__ [as 别名]
def __init__(self, *args, **kwargs):
# initialize our super classes
Scraper.__init__(self) #, prefetch=self.prefetch)
# set regex's
self.__set_regex()
示例9: __init__
# 需要导入模块: from scraper import Scraper [as 别名]
# 或者: from scraper.Scraper import __init__ [as 别名]
def __init__(self):
Scraper.__init__(self)
self.site = "monova.com"