可以直接添加进项目中使用,仅需改为自己想要的数据格式;
接口数据读取;
添加正则表达式或固定格式可爬取特定数据:(如邮件,电话号码,QQ号码等)
可用于在其他网站爬取数据,开发其第三方网站;
exe小程序数据保存在本地;
源码接口爬来的Json数据,需自己解析,灵活处理
package com.haoxuan.view;
import java.awt.BorderLayout;
public class CreeperOption {
private static JFrame frame;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
CreeperOption window = new CreeperOption();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public CreeperOption() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocation(800, 350);
frame.setSize(400, 400);
frame.setTitle("爬虫入口");
Image img = new ImageIcon(this.getClass().
getResource("/images/001.jpg")).getImage();
frame.setIconImage(img);
MainLoginPanel loginPanel = new MainLoginPanel();
frame.setContentPane(loginPanel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.setResizable(false);
frame.addWindowListener(new WindowsHandler());
}
private class MainLoginPanel extends JPanel{
JLabel picLabel;
JButton stuLoginButton,tchLoginButton;
JPanel infoPanel;
public MainLoginPanel(){
picLabel =new JLabel();
stuLoginButton = new JButton("点击跳转到信息配置界面");
infoPanel=new JPanel();
setLayout(new BorderLayout());
infoPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
picLabel.setSize(400, 300);
ImageIcon image = new ImageIcon(frame.getClass().
getResource("/images/top2.jpg"));
image.setImage(image.getImage().getScaledInstance( picLabel.
getWidth(),picLabel.getHeight(), Image.SCALE_DEFAULT));
picLabel.setIcon(image);
infoPanel.add(picLabel);
infoPanel.add(stuLoginButton);
add(infoPanel,BorderLayout.CENTER);
ButtonAction buttonAction = new ButtonAction();
stuLoginButton.addActionListener(buttonAction);
}
private class ButtonAction implements ActionListener{
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(stuLoginButton)){