python 爬虫百度地图的信息界面的实现方法

yipeiwu_com6年前Python爬虫

在爬虫百度地图的期间,就为它做了一个界面,运用的是PyQt5。

得到意想不到的结果:

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'E:\pycharm_workspase\sprider_baidumap\src\view\provinces.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!


from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_Form(object):
  def setupUi(self, Form):
    Form.setObjectName("Form")
    Form.resize(589, 500)

    self.comboBox_city = QtWidgets.QComboBox(Form)
    self.comboBox_city.setGeometry(QtCore.QRect(50, 60, 161, 31))
    self.comboBox_city.setEditable(True)
    self.comboBox_city.setCurrentText("")
    self.comboBox_city.setIconSize(QtCore.QSize(20, 20))
    self.comboBox_city.setObjectName("comboBox_city")

    self.result = QtWidgets.QTextBrowser(Form)
    self.result.setGeometry(QtCore.QRect(50, 150, 481, 300))
    self.result.setEnabled(False)
    font = QtGui.QFont()
    font.setBold(False)
    font.setWeight(50)
    self.result.setFont(font)
    self.result.setObjectName("result")

    self.keyWord = QtWidgets.QTextEdit(Form)
    self.keyWord.setEnabled(True)
    self.keyWord.setGeometry(QtCore.QRect(230, 60, 151, 31))
    self.keyWord.setObjectName("keyWord")

    self.pushButton = QtWidgets.QPushButton(Form)
    self.pushButton.setGeometry(QtCore.QRect(400, 60, 131, 31))
    self.pushButton.setObjectName("pushButton")

    self.label = QtWidgets.QLabel(Form)
    self.label.setGeometry(QtCore.QRect(50, 110, 111, 31))
    font = QtGui.QFont()
    font.setFamily("Arial Black")
    font.setPointSize(14)
    font.setBold(True)
    font.setWeight(75)
    self.label.setFont(font)
    self.label.setObjectName("label")

    self.retranslateUi(Form)
    QtCore.QMetaObject.connectSlotsByName(Form)

  def retranslateUi(self, Form):
    _translate = QtCore.QCoreApplication.translate
    Form.setWindowTitle(_translate("Form", "百度地图商家信息列表"))
    self.pushButton.setText(_translate("Form", "确定"))
    self.label.setText(_translate("Form", "查询结果:"))

界面还是不错的,自恋一下。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持【听图阁-专注于Python设计】。

相关文章

Python使用requests及BeautifulSoup构建爬虫实例代码

Python使用requests及BeautifulSoup构建爬虫实例代码

本文研究的主要是Python使用requests及BeautifulSoup构建一个网络爬虫,具体步骤如下。 功能说明 在Python下面可使用requests模块请求某个url获取响应...

python爬取指定微信公众号文章

本文实例为大家分享了python爬取微信公众号文章的具体代码,供大家参考,具体内容如下 该方法是依赖于urllib2库来完成的,首先你需要安装好你的python环境,然后安装urllib...

python动态网页批量爬取

python动态网页批量爬取

四六级成绩查询网站我所知道的有两个:学信网(http://www.chsi.com.cn/cet/)和99宿舍(http://cet.99sushe.com/),这两个网站采用的都是动态...

Python爬虫PyQuery库基本用法入门教程

Python爬虫PyQuery库基本用法入门教程

本文实例讲述了Python爬虫PyQuery库基本用法。分享给大家供大家参考,具体如下: PyQuery库也是一个非常强大又灵活的网页解析库,如果你有前端开发经验的,都应该接触过jQue...

python爬虫中get和post方法介绍以及cookie作用

首先确定你要爬取的目标网站的表单提交方式,可以通过开发者工具看到。这里推荐使用chrome。 这里我用163邮箱为例 打开工具后再Network中,在Name选中想要了解的网站,右侧...