Esempio n. 1
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.url_pattern = re.compile(
         ur'^http://\w+\.ganji\.com(|/|/fang1/?|/fang1/\d+x\.htm|/fang1/tuiguang[-]\d+.htm|/fang1/f\d+/?)$',
         re.U | re.I)
     self.arch_pattern = re.compile(
         ur'[房户](\s|&nbsp;)*型[^::]*[::]([^\d]*)(\d[^<>\s]+)[\s<]',
         re.U | re.I)
Esempio n. 2
0
def run(T):
	t = 0.
	bot = Robot()
	tau  = 0.0005

	while t < T:
		print bot.q
		bot.log.append(bot.q)
		
		bot.next_pos(tau)
		t += tau

	speedup = 0.1
	show('jump.html', bot.log, tau/speedup)
Esempio n. 3
0
 def is_valid_url(self, url):
     #print url
     ans = Robot.is_valid_url(self, url) and self.url_pattern.match(
         url) != None and not url.startswith(
             'http://www.ganji.com/fang1') and not url.startswith(
                 'http://help.ganji.com') and not url.startswith(
                     'http://club.ganji.com')
     #print ans
     return ans
Esempio n. 4
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.url_pattern = re.compile(
         ur'^http://[\w\d\.]+\.soufun\.com(|/|/house/?|/chuzu/[\d_]+\.htm)$',
         re.U | re.I)
Esempio n. 5
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.url_pattern = re.compile(ur'^http://\w+\.ganji\.com(|/|/fang1/?|/fang1/\d+x\.htm|/fang1/tuiguang[-]\d+.htm|/fang1/f\d+/?)$', re.U | re.I)
     self.arch_pattern = re.compile(ur'[房户](\s|&nbsp;)*型[^::]*[::]([^\d]*)(\d[^<>\s]+)[\s<]', re.U | re.I)
Esempio n. 6
0
 def is_valid_url(self, url):
     #print url
     ans = Robot.is_valid_url(self, url) and self.url_pattern.match(url) != None and not url.startswith('http://www.ganji.com/fang1') and not url.startswith('http://help.ganji.com') and not url.startswith('http://club.ganji.com')
     #print ans
     return ans
Esempio n. 7
0
    def get_address(self, page):
        ans = Robot.get_address(self, page)
        if ans == None:
            ans = Robot.get_district(self, page)

        return ans
Esempio n. 8
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.url_pattern = re.compile(
         ur'^http://\w+.anjuke.com/(rental/(p\d+)?|prop/rent/\d+)/?$')
Esempio n. 9
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.arch_pattern = re.compile(ur'[房户](\s|&nbsp;)*型[^::]*[::]\s*(<b>)(\d[^<\s]+)[<\s]', re.U | re.I)
     self.url_pattern = re.compile(ur'^http://\w+\.esf\.focus\.cn(|/|/zufang/?|/zufang/\d+\.html|/zufang/zj0m0h0jz0zx0zlfs0bq0fbr0p\d+px0t0jd0bx0pic0q0b0xl0zd0xq0st1s0tx1/?)$', re.U | re.I)
Esempio n. 10
0
 def is_valid_url(self, url):
     return Robot.is_valid_url(self, url) and self.url_pattern.match(url) != None
Esempio n. 11
0
    def get_address(self, page):
        ans = Robot.get_address(self, page)
        if ans == None:
            ans = Robot.get_district(self, page)

        return ans
Esempio n. 12
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.url_pattern = re.compile(ur'^http://\w+.anjuke.com/(rental/(p\d+)?|prop/rent/\d+)/?$')
Esempio n. 13
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.url_pattern = re.compile(ur'^(http://\w+\.zufang\.sina\.com\.cn(|/|/detail/\d+/?|/house/(n\d+)?/?)|http://\w+\.esf\.sina\.com\.cn/?)$', re.U | re.I)
Esempio n. 14
0
 def is_valid_url(self, url):
     return Robot.is_valid_url(self, url) and self.url_pattern.match(url) != None
Esempio n. 15
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.url_pattern = re.compile(
         ur'http://\w+\.haozu\.com/(listing/(p%d+)?|rental/broker/n/\d+)?/?$'
     )
Esempio n. 16
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.url_pattern = re.compile(ur'http://\w+\.58\.com/zufang/(pn\d+/?|\d+x.shtml)?$', re.U | re.I)
Esempio n. 17
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.url_pattern = re.compile(ur'http://\w+\.haozu\.com/(listing/(p%d+)?|rental/broker/n/\d+)?/?$')
Esempio n. 18
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.url_pattern = re.compile(ur'^http://[\w\d\.]+\.soufun\.com(|/|/house/?|/chuzu/[\d_]+\.htm)$', re.U | re.I)
Esempio n. 19
0
 def __init__(self, root, charset):
     Robot.__init__(self, root, charset)
     self.url_pattern = re.compile(
         ur'^(http://\w+\.zufang\.sina\.com\.cn(|/|/detail/\d+/?|/house/(n\d+)?/?)|http://\w+\.esf\.sina\.com\.cn/?)$',
         re.U | re.I)