def get_app_list_elements(self, url) -> list: response = RqCompoent.post(self.url, data={}) big_dict = json.loads(response) html = big_dict.get("html").replace("=/", "=") selector = etree.HTML(html) lis = selector.xpath("//div[@class='cp-box clearfix']") return lis
def get_app_list_elements(self, url="http://zhiyingyong.com/search") -> list: response = RqCompoent.post(url, {"apptitle": self.keyword}, {"Referer": "http://zhiyingyong.com"}) self.outer_response = response # print(response) selector = etree.HTML(response) lis = selector.xpath( "//div[@class='content-categoryCtn']/div[@class='content-categoryCtn-content clearfix']//div[@class='app-max']" ) # print(lis) return lis
def get_app_list_elements(self, url) -> list: add_headers = {"referer": "https://m.pp.cn/search.html"} self.add_headers = add_headers response = RqCompoent.post(url, data={ "q": self.keyword, "page": "1" }, **add_headers) big_dict = json.loads(response) items = big_dict.get("data").get("content") return items
def temp_request(self, enter_url, method="get", data={}): if method == "get": inner_response = RqCompoent.get(enter_url, **self.add_headers) else: inner_response = RqCompoent.post( enter_url, data, **self.add_headers)