我想砍人。
这么简单,我特么搞了整整一天。从昨天下午到今天11:40.
WTF!
以下是代码(目的想把爬取到的数据存入PostgreSQL):
class PostgreSQLPipeline(object):
def process_item(self,item, spider)
#sql_desc="INSERT INTO postgresql_1(fullname, username, organization, mail, joined,followers,starred,following,popular_repos,popular_repos_download,popular_repos_star,popular_repos_info,home_page)values(item['fullname'], item['username'], item['organization'], item['mail'],item['joined'],item['followers'],item['starred'],item['following'],item['popular_repos'],item['popular_repos_download'],item['popular_repos_star'],item['popular_repos_info'], item['home_page'])"
conn = psycopg2.connect(database="mypg", user="postgres", password="student", host="127.0.

博主在经历了一整天的尝试后,成功将使用Scrapy爬取的数据存入PostgreSQL数据库。过程中遇到了诸多错误,经过大约70次的测试,最终在mypg数据库的postgresql_1表中成功存储了数据。
2780

被折叠的 条评论
为什么被折叠?



