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

yipeiwu_com7年前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爬虫 urllib模块发起post请求过程解析

python爬虫 urllib模块发起post请求过程解析

urllib模块发起的POST请求 案例:爬取百度翻译的翻译结果 1.通过浏览器捉包工具,找到POST请求的url 针对ajax页面请求的所对应url获取,需要用到浏览器的捉包工具。...

Python使用Selenium模块实现模拟浏览器抓取淘宝商品美食信息功能示例

本文实例讲述了Python使用Selenium模块实现模拟浏览器抓取淘宝商品美食信息功能。分享给大家供大家参考,具体如下: import re from selenium impor...

Python使用Beautiful Soup包编写爬虫时的一些关键点

1.善于利用soup节点的parent属性 比如对于已经得到了如下html代码: <td style="padding-left:0" width="60%"><l...

Python 抓取动态网页内容方案详解

Python 抓取动态网页内容方案详解

用Python实现常规的静态网页抓取时,往往是用urllib2来获取整个HTML页面,然后从HTML文件中逐字查找对应的关键字。如下所示: 复制代码 代码如下: import urlli...