def basicinfo_execute(self, pageSoup): info = self.parse(pageSoup, tag='div', attrs={'rel': 'layout-01_01'}) if info != []: info[0] = common.basicinfo_dict(info[0], u'上海市') self.qyxx_basicinfo = info
def basicinfo_execute(self, id): """基本信息""" data = { 'method': 'qyInfo', 'maent.pripid': id, 'czmk': 'czmk1', 'random': str(int(time.time() * 1000)) } resp = url_requests.post(url=self.url, data=data, headers=self.headers) soup = BeautifulSoup(resp.content, 'lxml') if soup: self.reg_soup = soup.find('div', {'id': 'jibenxinxi'}) # # 保存登记信息的soup对象,用于股东与变更。 info = self.parse(pageSoup=self.reg_soup, tag='table', attrs={'class': 'detailsList'}) if info: info[0] = common.basicinfo_dict(info[0], '四川省') self.qyxx_basicinfo = info
def basicinfo_execute(self, pageSoup): br_keyword = [u"基本信息"] dict_ba = common.get_dict(pageSoup, br_keyword, class_="detailsList") if dict_ba != {}: dict_ba = common.basicinfo_dict(dict_ba, u'广西') dict_ba_list = [] dict_ba_list.append(dict_ba) return dict_ba_list
def basicinfo_execute(self, page_soup): soup = page_soup.find('table', {'class': 'tableYyzz'}) if soup: td = soup.find_all('td') info = {} for each_td in td: key_value = each_td.text.split(':') if key_value[0]: key = key_value[0][1:].strip() value = key_value[1].strip() info[key] = value info = common.basicinfo_dict(info, '河北省') self.qyxx_basicinfo.append(info)
def basicinfo_execute(self, **kwargs): soup = kwargs.get('soup') basicinfo = soup.find('div', class_='overview') keys = basicinfo.find_all('dt') values = basicinfo.find_all('dd') info = {} for i, each_key in enumerate(keys): key = each_key.text.replace('\n', '')\ .replace('\r', '')\ .replace('\t', '')\ .strip()[:-1] try: value = values[i].text.replace('\n', '')\ .replace('\r', '')\ .replace('\t', '')\ .strip() except IndexError: value = '' info[key] = value self.qyxx_basicinfo.append(common.basicinfo_dict(info, ''))
def basicinfo_execute(self, data): ''' :return: 基本信息 dict ''' url = 'http://gsxt.gzaic.gov.cn/aiccips/GSpublicity/GSpublicityList.html?service=entInfo' response = url_requests.post(url, headers=self.headers, data=data, cookies=self.cookies) soup = BeautifulSoup(response.text, 'lxml') # soup = soup.find('table', {'id': 'baseinfo'}) if soup == None: raise RequestError("没有查询到企业的相关信息,应该是访问出错了。") Info = self.parse(soup, 'table', {'id': 'baseinfo'}) if Info: if Info[0].has_key('统一社会信用代码') and Info[0].has_key('注册号'): if Info[0]['统一社会信用代码'] == '': Info[0]['统一社会信用代码'] = Info[0]['注册号'] Info[0] = common.basicinfo_dict(Info[0], '广州市') self.qyxx_basicinfo = Info
def basicinfo_execute(self, page_soup_origin): url = 'http://gx.gsxt.gov.cn/gjjbj/gjjQueryCreditAction!openEntInfo.dhtml' headers = { 'Host': 'gx.gsxt.gov.cn', 'User-Agent': ('Mozilla/5.0 (Windows NT 6.1; WOW64) ' 'AppleWebKit/537.36 (KHTML, like Gecko) ' 'Chrome/54.0.2840.99 Safari/537.36') } resp = url_requests.get(url, headers=headers, params=self.params, proxies=proxies) self.basic_content = resp.content # print type(self.basic_content) page_soup = BeautifulSoup(self.basic_content, 'lxml') soup = page_soup.find('table', {'class': 'qy-list'}) if soup: td = soup.find_all('td') info = {} for each_td in td: key_value = each_td.text.split(':') if key_value[0]: key = key_value[0].strip() value = key_value[1].strip() info[key] = value info = common.basicinfo_dict(info, '广西省') self.qyxx_basicinfo.append(info) uniscid_flag = page_soup_origin.findAll( name='a', attrs={"href": re.compile(r'uniscid')}) self.regno = self.qyxx_basicinfo[0]["reg_num"] if uniscid_flag != []: p = 'regno=\w+' s0 = uniscid_flag[0]['href'] if re.search(p, s0) != None: s = re.search(p, s0).group() self.regno = s.split('=')[1]
def basicinfo_execute(self): url = ('http://%s/aiccips/GSpublicity/GSpublicityList' '.html?service=entInfo') % self.host response = url_requests.post(url=url, data=self.data, headers=self.headers, proxies=proxies) soup = BeautifulSoup(response.text, 'lxml') self.soup = soup # 赋值到属性,可获取营业执照、主要成员、分支机构三项信息 body = soup.find('div', {'style': 'padding-left: 14px'}) info = {} labels = body.find_all('span', class_='label') for label in labels: key = label.text.replace(':', '').strip() value = label.next_sibling.text.strip() info[key] = value info = common.basicinfo_dict(info, '广东省') self.qyxx_basicinfo.append(info)