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 math import ceil | |
from scrapy import Request, Spider | |
class BookSpider(Spider): | |
name = 'books_toscrape_com' | |
start_urls = ['http://books.toscrape.com/'] | |
def parse(self, response): | |
books = response.css("ol.row > li") |
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
#!/usr/bin/env bash | |
# memusg -- Measure memory usage of processes | |
# Usage: memusg COMMAND [ARGS]... | |
# | |
# Author: Jaeho Shin <[email protected]> | |
# Created: 2010-08-16 | |
############################################################################ | |
# Copyright 2010 Jaeho Shin. # | |
# # | |
# Licensed under the Apache License, Version 2.0 (the "License"); # |
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 json | |
from scrapy.http import Request | |
from scrapy.selector import Selector | |
from forumbot.spiders.blogs import BlogSpider | |
from forumbot.spiders.mixins.livefyre import LivefyreMixin | |
from bot_engines.utils import error | |
from forumbot.items import BlogPostLoader, AuthorLoader |
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
<html> | |
<head> | |
<meta http-equiv="Pragma" content="no-cache"/> | |
<meta http-equiv="Expires" content="-1"/> | |
<meta http-equiv="CacheControl" content="no-cache"/> | |
<script type="text/javascript"> | |
function challenge() { | |
var x = 17; | |
var y = 25; | |
var challenge_answer = (x * y) + 9; |
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 random import choice | |
from scrapy import signals | |
from scrapy.exceptions import NotConfigured | |
class RotateUserAgentMiddleware(object): | |
"""Rotate user-agent for each request.""" | |
def __init__(self, user_agents): | |
self.enabled = False | |
self.user_agents = user_agents |