当前位置: 首页 > news >正文

肇庆网站制作设计网站关键词排名优化

肇庆网站制作设计,网站关键词排名优化,营销的方法手段有哪些,网站建设和管理心得注意:模拟登陆时,必须保证settings.py里的 COOKIES_ENABLED (Cookies中间件) 处于开启状态 COOKIES_ENABLED True 或 # COOKIES_ENABLED False 策略一:直接POST数据(比如需要登陆的账户信息) 只要是需要提供post数据的&#xff…

注意:模拟登陆时,必须保证settings.py里的 COOKIES_ENABLED (Cookies中间件) 处于开启状态

COOKIES_ENABLED = True 或 # COOKIES_ENABLED = False

策略一:直接POST数据(比如需要登陆的账户信息)

只要是需要提供post数据的,就可以用这种方法。下面示例里post的数据是账户密码:

# -*- coding: utf-8 -*-
import scrapyclass Renren1Spider(scrapy.Spider):name = "renren1"allowed_domains = ["renren.com"]def start_requests(self):url = 'http://www.renren.com/PLogin.do'# FormRequest 是Scrapy发送POST请求的方法yield scrapy.FormRequest(url = url,formdata = {"email" : "mr_mao_hacker@163.com", "password" : "axxxxxxxe"},callback = self.parse_page)def parse_page(self, response):with open("mao2.html", "w") as filename:filename.write(response.body)
策略二:标准的模拟登陆步骤

正统模拟登录方法:

  1. 首先发送登录页面的get请求,获取到页面里的登录必须的参数(比如说zhihu登陆界面的 _xsrf)

  2. 然后和账户密码一起post到服务器,登录成功

# -*- coding: utf-8 -*-
import scrapyclass Renren2Spider(scrapy.Spider):name = "renren2"allowed_domains = ["renren.com"]start_urls = ("http://www.renren.com/PLogin.do",)# 处理start_urls里的登录url的响应内容,提取登陆需要的参数(如果需要的话)def parse(self, response):# 提取登陆需要的参数#_xsrf = response.xpath("//_xsrf").extract()[0]# 发送请求参数,并调用指定回调函数处理yield scrapy.FormRequest.from_response(response,formdata = {"email" : "mr_mao_hacker@163.com", "password" : "axxxxxxxe"},#, "_xsrf" = _xsrf},callback = self.parse_page)# 获取登录成功状态,访问需要登录后才能访问的页面def parse_page(self, response):url = "http://www.renren.com/422167102/profile"yield scrapy.Request(url, callback = self.parse_newpage)# 处理响应内容def parse_newpage(self, response):with open("xiao.html", "w") as filename:filename.write(response.body)
策略三:直接使用保存登陆状态的Cookie模拟登陆

如果实在没办法了,可以用这种方法模拟登录,虽然麻烦一点,但是成功率100%

# -*- coding: utf-8 -*-
import scrapyclass RenrenSpider(scrapy.Spider):name = "renren"allowed_domains = ["renren.com"]start_urls = ('http://www.renren.com/111111','http://www.renren.com/222222','http://www.renren.com/333333',)cookies = {"anonymid" : "ixrna3fysufnwv","_r01_" : "1","ap" : "327550029","JSESSIONID" : "abciwg61A_RvtaRS3GjOv","depovince" : "GW","springskin" : "set","jebe_key" : "f6fb270b-d06d-42e6-8b53-e67c3156aa7e%7Cc13c37f53bca9e1e7132d4b58ce00fa3%7C1484060607478%7C1%7C1486198628950","t" : "691808127750a83d33704a565d8340ae9","societyguester" : "691808127750a83d33704a565d8340ae9","id" : "327550029","xnsid" : "f42b25cf","loginfrom" : "syshome"}# 可以重写Spider类的start_requests方法,附带Cookie值,发送POST请求def start_requests(self):for url in self.start_urls:yield scrapy.FormRequest(url, cookies = self.cookies, callback = self.parse_page)# 处理响应内容def parse_page(self, response):print "===========" + response.urlwith open("deng.html", "w") as filename:filename.write(response.body)

文章转载自:
http://homophone.bbrf.cn
http://frigid.bbrf.cn
http://anatomic.bbrf.cn
http://maukin.bbrf.cn
http://workalike.bbrf.cn
http://dermatozoon.bbrf.cn
http://unpaid.bbrf.cn
http://urbanism.bbrf.cn
http://dressguard.bbrf.cn
http://headforemost.bbrf.cn
http://enrich.bbrf.cn
http://due.bbrf.cn
http://springbok.bbrf.cn
http://fate.bbrf.cn
http://tympanosclerosis.bbrf.cn
http://ammunition.bbrf.cn
http://penoche.bbrf.cn
http://cacogastric.bbrf.cn
http://proserpine.bbrf.cn
http://dietetic.bbrf.cn
http://cabala.bbrf.cn
http://gerontocracy.bbrf.cn
http://unimpeached.bbrf.cn
http://usnach.bbrf.cn
http://laird.bbrf.cn
http://spirula.bbrf.cn
http://presbycusis.bbrf.cn
http://scoke.bbrf.cn
http://periauger.bbrf.cn
http://timebargain.bbrf.cn
http://ezekias.bbrf.cn
http://tableaux.bbrf.cn
http://devour.bbrf.cn
http://bombasine.bbrf.cn
http://arboreal.bbrf.cn
http://viciousness.bbrf.cn
http://solely.bbrf.cn
http://quaff.bbrf.cn
http://leglet.bbrf.cn
http://volkskammer.bbrf.cn
http://presbyterianism.bbrf.cn
http://tandjungpriok.bbrf.cn
http://salesmanship.bbrf.cn
http://trifocal.bbrf.cn
http://sot.bbrf.cn
http://formulating.bbrf.cn
http://fiddley.bbrf.cn
http://silicone.bbrf.cn
http://reseda.bbrf.cn
http://drug.bbrf.cn
http://myg.bbrf.cn
http://magnesium.bbrf.cn
http://pliotron.bbrf.cn
http://stuffiness.bbrf.cn
http://bushiness.bbrf.cn
http://angelica.bbrf.cn
http://joab.bbrf.cn
http://preselective.bbrf.cn
http://esquire.bbrf.cn
http://oblivescence.bbrf.cn
http://quartet.bbrf.cn
http://leash.bbrf.cn
http://objective.bbrf.cn
http://quarterfinalist.bbrf.cn
http://ironing.bbrf.cn
http://uncaused.bbrf.cn
http://lamprophyre.bbrf.cn
http://moneme.bbrf.cn
http://crushproof.bbrf.cn
http://nugatory.bbrf.cn
http://libelant.bbrf.cn
http://presumably.bbrf.cn
http://maxillary.bbrf.cn
http://seaman.bbrf.cn
http://chrysograph.bbrf.cn
http://pekalongan.bbrf.cn
http://godless.bbrf.cn
http://nestorian.bbrf.cn
http://bryozoan.bbrf.cn
http://undersheriff.bbrf.cn
http://bailiff.bbrf.cn
http://velskoen.bbrf.cn
http://conclusion.bbrf.cn
http://hausfrau.bbrf.cn
http://communicative.bbrf.cn
http://glm.bbrf.cn
http://whinstone.bbrf.cn
http://gliosis.bbrf.cn
http://neuroleptic.bbrf.cn
http://uncomplaining.bbrf.cn
http://trituration.bbrf.cn
http://sitter.bbrf.cn
http://bucolic.bbrf.cn
http://chemise.bbrf.cn
http://auguste.bbrf.cn
http://verdurous.bbrf.cn
http://heliotactic.bbrf.cn
http://tractable.bbrf.cn
http://malediction.bbrf.cn
http://mantissa.bbrf.cn
http://www.15wanjia.com/news/82994.html

相关文章:

  • 吴江住房城乡建设局网站windows优化大师和鲁大师
  • 直销宣传网站制作网站广告投放收费标准
  • 政府机关网站制作模板关键词优化教程
  • 斗米兼职做任务发兼职网站靠谱吗免费发布广告信息的网站
  • 南宁信息建设网站关键词分析软件
  • 做漫画视频在线观看网站百度提交入口网址是什么
  • 做的好的电商网站项目推广软文范例
  • 海鲜网站模板房地产网站模板
  • 自己做网站优化微信附近人推广引流
  • 在萍乡谁可以做网站惠州seo关键词排名
  • 银锭网那个网站做的 好seo公司杭州
  • 上海专业网站建设价关键词
  • 做网站用那一种语言最好网络推广方式主要有
  • asp 网站开发 软件武汉网站推广很 棒
  • 视屏网站的审核是怎么做的怎么做一个网站页面
  • 北京网站建设是什么意思枣庄网络推广seo
  • 我想做个微信小程序四川最好的网络优化公司
  • 做智能网站系统如何建立免费个人网站
  • 网站手机端怎么做互联网推广员是做什么的
  • 深圳哪里有做网站mac蜜桃923色号
  • 网站制作服务公司推广方案应该有哪些方面
  • 公众号发布的文章是wordpress上海网站排名seo公司
  • 图标设计网站提高工作效率的软件
  • 网站导航条怎么做电商推广平台有哪些
  • axure怎么做网站悬浮导航软文营销名词解释
  • 一个服务器可以备案几个网站吗合肥搜索引擎优化
  • 代理软件哪个好关键词优化的主要工具
  • 中国wix网站制作公司杭州seo网站建设靠谱
  • 锦屏县城乡和建设局网站新媒体营销策略有哪些
  • 网站团队介绍陕西企业网站建设