• login


    # -*- coding: utf-8-*-
    from lxml import etree
    import urllib2
    import urllib
    import sys
    reload(sys)
    sys.setdefaultencoding('utf-8')



    hosturl ='***'

    posturl = '***'

    h = urllib2.urlopen(hosturl)



    postData = {
    'username' : '****',
    'password' : '***',
    'mod':'***',
    'action':'***',
    '_r':'***',
    'inajax':'*',
    'ajaxtarget':'****'
    }

    postData = urllib.urlencode(postData)
    request = urllib2.Request(posturl, postData)
    response = urllib2.urlopen(request)

    detailurl= urllib2.urlopen('****')
    menu = detailurl.read()

    ress = etree.HTML(menu)
    menudetail = ress.xpath('//select[@id="food_id"]/option/text()')



    posturl2 = '****'
    data = {
    'flag':'0',
    'class_id':'2',
    'area_id':'1',
    'saler_id':'19758',
    'food_id':'146',
    'add_date':'2016-12-26',
    'food_num':'2',
    'reason':''
    }

    cookies = '********'
    HEADER = {
    'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0',
    'Cookie':cookies
    }

    postData2 = urllib.urlencode(data)
    request = urllib2.Request(posturl2, postData2,headers=HEADER)
    response = urllib2.urlopen(request)

    print response.read()
  • 相关阅读:
    centos7手动搭建redis集群
    Xshell突破四个窗口限制
    Redis官方集群规范
    Redis官方集群教程
    centos7 更新阿里YUM源
    gitlab配置ssh
    Java前端控制器模式~
    Java数据访问对象模式
    Java组合实体模式~
    Java业务代理模式~
  • 原文地址:https://www.cnblogs.com/cutepython/p/6215810.html
Copyright © 2020-2023  润新知