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
# coding=utf-8 | |
''' | |
Created on 2011-7-1 | |
@author: Yunanw | |
''' | |
import cookielib, urllib2, urllib | |
import time | |
import lxml.html as H |
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
public static String ReadUntil(this StreamReader reader, char delimeter) | |
{ | |
StringBuilder sb = new StringBuilder(); | |
char c; | |
while ((c = (char)reader.Read()) != 0) | |
{ | |
if (c == delimeter) | |
return sb.ToString(); | |
else | |
sb.Append(c); |