WPF MaterialDesign 初学项目实战(3)动态侧边栏

news2024/10/6 8:30:46

其他文章

WPF MaterialDesign 初学项目实战(0):github 项目Demo运行
WPF MaterialDesign 初学项目实战(1)首页搭建
WPF MaterialDesign 初学项目实战(2)首页导航栏样式

创建侧边栏实体类

新建MenuBar文件

  • Common
    • Models
      • MenuBar

在这里插入图片描述

添加基本成员

using MaterialDesignColors.Recommended;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyToDo.Common.Models
{
    /// <summary>
    /// 系统导航菜单
    /// </summary>
    public class MenuBar : BindableBase//继承BindableBase可以动态修改
    {
        /// <summary>
        /// 菜单图标
        /// </summary>
        public string? Icon { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string? Title { get; set; }   

        /// <summary>
        /// 命名空间
        /// </summary>
        public string? NameSpace { get; set; }

    }
}

创建Views和ViewModels文件夹

注意,Views和VIewModels文件夹的名字是一定要这么写,这和Prism框架的自动绑定有关
绑定关系为:

  • Views
    • xxxView
  • ViewModels
    • xxxViewModel

自动绑定命名空间为:

xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True"

在这里插入图片描述
创建MainView和MainViewModel文件
在这里插入图片描述
将MainWindow内容复制到MainView里面,将命名空间进行修改

<Window x:Class="MyToDo.Views.MainView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MyToDo"
        mc:Ignorable="d"
        Title="MainWindow"
        Height="768"
        Width="1280"
        xmlns:prism="http://prismlibrary.com/"
        prism:ViewModelLocator.AutoWireViewModel="True"        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
        TextElement.Foreground="{DynamicResource MaterialDesignBody}"
        TextElement.FontWeight="Regular"
        TextElement.FontSize="13"
        TextOptions.TextFormattingMode="Ideal"
        TextOptions.TextRenderingMode="Auto"
        WindowStartupLocation="CenterScreen"
        WindowStyle="None"
        Background="{DynamicResource MaterialDesignPaper}"
        FontFamily="{DynamicResource MaterialDesignFont}">
    <materialDesign:DialogHost DialogTheme="Inherit"
                               Identifier="RootDialog"
                               SnackbarMessageQueue="{Binding ElementName=MainSnackbar, Path=MessageQueue}">

        <materialDesign:DrawerHost IsLeftDrawerOpen="{Binding ElementName=MenuToggleButton, Path=IsChecked}">
            <materialDesign:DrawerHost.LeftDrawerContent>
                <DockPanel MinWidth="220">

                </DockPanel>
            </materialDesign:DrawerHost.LeftDrawerContent>

            <DockPanel>
                <materialDesign:ColorZone Padding="16"
                                          x:Name="MainBody"
                                          materialDesign:ElevationAssist.Elevation="Dp4"
                                          DockPanel.Dock="Top"
                                          Mode="PrimaryMid">
                    <DockPanel LastChildFill="False">
                        <StackPanel Orientation="Horizontal">
                            <ToggleButton x:Name="MenuToggleButton"
                                          AutomationProperties.Name="HamburgerToggleButton"
                                          IsChecked="False"
                                          Style="{StaticResource MaterialDesignHamburgerToggleButton}" />

                            <Button Margin="24,0,0,0"
                                    materialDesign:RippleAssist.Feedback="{Binding RelativeSource={RelativeSource Self}, Path=Foreground, Converter={StaticResource BrushRoundConverter}}"
                                    Command="{Binding MovePrevCommand}"
                                    Content="{materialDesign:PackIcon Kind=ArrowLeft,
                                                        Size=24}"
                                    Foreground="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"
                                    Style="{StaticResource MaterialDesignToolButton}"
                                    ToolTip="Previous Item" />

                            <Button Margin="16,0,0,0"
                                    materialDesign:RippleAssist.Feedback="{Binding RelativeSource={RelativeSource Self}, Path=Foreground, Converter={StaticResource BrushRoundConverter}}"
                                    Command="{Binding MoveNextCommand}"
                                    Content="{materialDesign:PackIcon Kind=ArrowRight,
                                                        Size=24}"
                                    Foreground="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"
                                    Style="{StaticResource MaterialDesignToolButton}"
                                    ToolTip="Next Item" />


                            <TextBlock Margin="25,0,0,0"
                                       HorizontalAlignment="Center"
                                       VerticalAlignment="Center"
                                       AutomationProperties.Name="Material Design In XAML Toolkit"
                                       FontSize="22"
                                       Text="笔记本" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal"
                                    DockPanel.Dock="Right">
                            <Image Width="25"
                                   Height="25"
                                   Source="/static/img/User/icon.png">
                                <Image.Clip>
                                    <EllipseGeometry Center="12.5,12.5"
                                                     RadiusX="12.5"
                                                     RadiusY="12.5" />
                                </Image.Clip>
                            </Image>
                            <Button x:Name="minBtn"
                                    Content="一"
                                    Style="{StaticResource MaterialDesignFlatMidBgButton}" />
                            <Button x:Name="maxBtn"
                                    Content="口"
                                    Style="{StaticResource MaterialDesignFlatMidBgButton}" />
                            <Button x:Name="closeBtn"
                                    Content="X"
                                    Style="{StaticResource MaterialDesignFlatMidBgButton}" />
                        </StackPanel>



                    </DockPanel>
                </materialDesign:ColorZone>

            </DockPanel>
        </materialDesign:DrawerHost>
    </materialDesign:DialogHost>
</Window>

MainViewModel文件,添加View文件上下文

using MyToDo.Common.Models;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyToDo.ViewModels
{
    public class MainViewModel : BindableBase//继承BindableBase可以动态更新
    {
        public MainViewModel()
        {
            MenuBars = new ObservableCollection<MenuBar>();
            CreateMenuBar();
        }

        private ObservableCollection<MenuBar> menuBars;

        public ObservableCollection<MenuBar> MenuBars
        {
            get { return menuBars; }
            set { menuBars= value; RaisePropertyChanged(); }
        } //动态更新列表

        void CreateMenuBar()
        {
            MenuBars.Add(new MenuBar { Icon = "Home", Title = "首页", NameSpace = "IndexView" });
            MenuBars.Add(new MenuBar { Icon = "Notebook", Title = "代办事项", NameSpace = "ToDoView" });
            MenuBars.Add(new MenuBar { Icon = "NotebookEdit", Title = "备忘录", NameSpace = "MemoView" });
            MenuBars.Add(new MenuBar { Icon = "CogOutline", Title = "设置", NameSpace = "SettingView" });
        }
    }
}

PS:为什么要有private menuBars 和 public MenuBars
在这里插入图片描述

        public ObservableCollection<MenuBar> MenuBars
        {
            get { return MenuBars; }//这里会报错
            set { MenuBars = value; RaisePropertyChanged(); }
        } //动态更新列表


        private ObservableCollection<MenuBar> menuBars;
        public ObservableCollection<MenuBar> MenuBars
        {
            get { return menuBars; }
            set { menuBars= value; RaisePropertyChanged(); }
        } //动态更新列表

删除原来的MainWindow文件

在App.xmal里面修改启动窗口

 public partial class App : PrismApplication
    {
        /// <summary>
        /// 重写运行主窗口
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        protected override Window CreateShell()
        {
            //重定向主窗口
            - return Container.Resolve<MainWindow>();
            + return Container.Resolve<MainView>();
            
        }

        /// <summary>
        /// 依赖注入
        /// </summary>
        /// <param name="containerRegistry"></param>
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
           
        }
    }

将元素添加到MainView页面
绑定数据上下文:{Binding 属性名}

注意:Views文件夹和ViewModels文件夹必须这样命名,启用Prism的自动联系上下文功能,并且对应文件名为MainView和MainViewModels

在这里插入图片描述

prism启动上下文功能:

xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True"
<materialDesign:DrawerHost IsLeftDrawerOpen="{Binding ElementName=MenuToggleButton, Path=IsChecked}">
            <materialDesign:DrawerHost.LeftDrawerContent>
                <DockPanel MinWidth="220">
                    <StackPanel>
                        <Image Width="50"
                               Height="50"
                               Source="/static/img/User/icon.png">
                            <Image.Clip>
                                <EllipseGeometry Center="25,25"
                                                 RadiusX="25"
                                                 RadiusY="25" />
                            </Image.Clip>
                        </Image>
                        <TextBlock  Text="Gclove2000"
                                    HorizontalAlignment="Center"
                                    />

                        <ListBox ItemsSource="{Binding MenuBars}" >
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <materialDesign:PackIcon Kind="{Binding Icon}" />
                                        <TextBlock Text="{Binding Title}" Margin="10,0"/>
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </StackPanel>
                </DockPanel>
            </materialDesign:DrawerHost.LeftDrawerContent>

运行效果:
在这里插入图片描述

修改MaterialDesign 的默认主题

在App.xmal文件中修改为黑色主题

在这里插入图片描述

<prism:PrismApplication x:Class="MyToDo.App"
                        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:local="clr-namespace:MyToDo"
                        xmlns:prism="http://prismlibrary.com/"
                        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <materialDesign:
                - BundledTheme BaseTheme="Light"
                + BundledTheme BaseTheme="Dark"
                                             PrimaryColor="DeepPurple"
                                             SecondaryColor="Lime" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</prism:PrismApplication>

在这里插入图片描述

如何添加自定义样式

在App.xmal文件中添加样式信息

<prism:PrismApplication x:Class="MyToDo.App"
                        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:local="clr-namespace:MyToDo"
                        xmlns:prism="http://prismlibrary.com/"
                        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <materialDesign:BundledTheme BaseTheme="Dark"
                                             PrimaryColor="DeepPurple"
                                             SecondaryColor="Lime" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <!--自定义样式 样式名:MyListBoxItemStyle,样式挂载:ListBoxItem-->
            <Style x:Key="MyListBoxItemStyle" TargetType="ListBoxItem">
                <!--自定义高度-->
                <Setter Property="MinHeight"
                        Value="40" />
                <Setter Property="Template">
                    <Setter.Value>
                        <!--影响属性 ListBoxItem-->
                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
                            <Grid>
                                <Border x:Name="borderHeader" />
                                <Border x:Name="border" />
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                                  VerticalAlignment="{TemplateBinding VerticalAlignment}"/>
                            </Grid>
                            
                            <!--触发器-->
                            <ControlTemplate.Triggers>
                                <!--ListBoxItem点击时触发-->
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="BorderThickness"
                                            TargetName="borderHeader"  Value="4,0,0,0"/>
                                    <Setter Property="BorderBrush"
                                            TargetName="borderHeader"
                                            Value="{DynamicResource PrimaryHueLightBrush}" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </Application.Resources>
</prism:PrismApplication>

在对应元素中引用样式

<ListBox ItemsSource="{Binding MenuBars}" 
+ ItemContainerStyle="{StaticResource MyListBoxItemStyle}" >
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <materialDesign:PackIcon Kind="{Binding Icon}" Margin="15,0" />
                                        <TextBlock Text="{Binding Title}" Margin="10,0"/>
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>

实现效果:有点丑,可以后面改一下
在这里插入图片描述

设置点击范围

在这里插入图片描述

<StackPanel Orientation="Horizontal"
            VerticalAlignment="Center"
            + Background="Transparent">没设置为蓝色点击范围,设置了为红色点击范围
    <materialDesign:PackIcon Kind="{Binding Icon}"
                             Margin="15,0" />
    <TextBlock Text="{Binding Title}"
               Margin="10,0" />
</StackPanel>

设置鼠标悬停效果

也是设置触发器
App.xmal

<!--自定义样式 样式名:MyListBoxItemStyle,样式挂载:ListBoxItem-->
<Style x:Key="MyListBoxItemStyle" TargetType="ListBoxItem">
   <!--自定义高度-->
   <Setter Property="MinHeight"
           Value="40" />
   <Setter Property="Template">
       <Setter.Value>
           <!--影响属性 ListBoxItem-->
           <ControlTemplate TargetType="{x:Type ListBoxItem}">
               <Grid>
                   <Border x:Name="borderHeader" />
                   <Border x:Name="border" />
                   <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                     VerticalAlignment="{TemplateBinding VerticalAlignment}"/>
               </Grid>
               
               <!--触发器-->
               <ControlTemplate.Triggers>
                   <!--ListBoxItem点击时触发-->
                   <Trigger Property="IsSelected" Value="True">
                       <Setter Property="BorderThickness"
                               TargetName="borderHeader"  Value="4,0,0,0"/>
                       <Setter Property="BorderBrush"
                               TargetName="borderHeader"
                               Value="{DynamicResource PrimaryHueLightBrush}" />
                       <Setter TargetName="border"
                               Property="Background"
                               Value="{DynamicResource PrimaryHueLightBrush}" />
                       <Setter TargetName="border"
                               Property="Opacity"
                               Value="0.4" />
                   </Trigger>
                   <!--鼠标悬停触发器触发器-->
                   + <Trigger Property="IsMouseOver" Value="True">
                   +    <Setter TargetName="border"
                   +            Property="Background"
                   +            Value="{DynamicResource PrimaryHueLightBrush}" />
                   +    <Setter TargetName="border"
                   +            Property="Opacity"
                   +            Value="0.4" />
                   + </Trigger>
               </ControlTemplate.Triggers>
           </ControlTemplate>
       </Setter.Value>
   </Setter>
</Style>

最终效果:

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/526402.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Python动物图像分割API简单调用实例演示,阿里达摩院视觉智能开放平台使用步骤

阿里云视觉智能开放平台 - 动物分割 效果图演示平台入口创建获取密钥本地图片转 URL 与密钥测试代码调用演示语义分割知识拓展阿里云达摩院智能视觉开放平台 效果图演示 调用本地图片处理后可以直接保存到本地&#xff0c;右边就是分割好的效果图&#xff0c;可以看到分割的效…

基于卷积的图像分类识别(五):ResNet ResNeXt

系列文章目录 本专栏介绍基于深度学习进行图像识别的经典和前沿模型&#xff0c;将持续更新&#xff0c;包括不仅限于&#xff1a;AlexNet&#xff0c; ZFNet&#xff0c;VGG&#xff0c;GoogLeNet&#xff0c;ResNet&#xff0c;DenseNet&#xff0c;SENet&#xff0c;MobileN…

C语言实现扫雷

总有一天你要一个人在暗夜中&#xff0c;向那座桥走过去 目录 一、文件及其对应代码 1.test.c 2.game.c 3.game.h 二、数组创建解析 1.创建两个数组的原因 2.预设数组较大的原因 三、计算周围雷的个数 四、向外扩展并延伸判断 扫雷游戏&#xff0c;相信大家都玩过&am…

【c++】图解类和对象(上)

类和对象&#xff08;上&#xff09; 文章目录 类和对象&#xff08;上&#xff09;一、面向过程和面向对象初步认识二、类的引入三、类的定义四、类的访问限定符及封装1.访问限定符2.封装 五、类的作用域六、类的实例化七、类对象模型八、this指针总结 一、面向过程和面向对象…

Mysql中select语句的执行流程?

Mysql中select语句的执行流程&#xff1f; 答&#xff1a; SELECT 语句的执行过程为&#xff1a;连接、查询缓存、a词法分析&#xff0c;语法分析&#xff0c;语义分析&#xff0c;构造执行树&#xff0c;生成执行计划、执行器执行计划&#xff0c;下面开始梳理一次完整的查询…

【MySQL】视图,事务、隔离级别

视图--虚表&#xff0c;不在数据库中存放数据&#xff0c;数据源于基本表。 为什么要使用视图 简化复杂的sql操作&#xff0c;在编写查询后&#xff0c;可以方便的重用它而不必知道它的查询细节。重复使用该sql语句。使用表的组成部分而不是整个表。保护数据&#xff0c;可以给…

vscode编译的时候:未定义标识符 thread

vscode编译的时候&#xff1a;未定义标识符 thread thread’ was not declared in this scope" 未定义标识符 thread 原因 MinGW GCC当前仍缺少标准C 11线程类的实现。 对于跨平台线程实现&#xff0c;GCC标准库依赖于gthreads / pthreads库。如果该库不可用&#xf…

手搓GPT系列之 - 通过理解LSTM的反向传播过程,理解LSTM解决梯度消失的原理 - 逐条解释LSTM创始论文全部推导公式,配超多图帮助理解(上篇)

1. 前言 说起RNN和LSTM&#xff0c;就绕不过Sepp Hochreiter 1997年的开山大作 Long Short-term Memory。奈何这篇文章写的实在是太劝退&#xff0c;整篇论文就2张图&#xff0c;网上很多介绍LSTM的文章都对这个模型反向传播的部分避重就轻&#xff0c;更少见&#xff08;反正…

2023/5/14学习总结

这道题我们可以看到数据范围很小 &#xff0c;所以可以使用暴力枚举&#xff0c;将所有可以组成长方形的长宽全遍历一遍&#xff0c;同时要满足这个长方形里没有障碍物的条件&#xff0c;取得周长最大值 #include<bits/stdc.h> using namespace std; typedef long long …

JavaSE基础(六)—— 面向对象、封装、对象内存图、成员变量和局部变量区别

目录 一、面向对象对象介绍 1. 面向对象的重点学习什么 二、设计对象并使用 1. 设计类&#xff0c;创建对象并使用 1.1 如何得到对象 1.2 如何使用对象 2. 定义类的几个补充注意事项 2.1 对象的成员变量的默认值规则 三、对象内存图 1. 多个对象内存图 2. 两个变量指…

Springboot +Flowable,流程表单应用之静态表单

一.简介 整体上来说&#xff0c;我们可以将Flowable 的表单分为三种不同的类型&#xff1a; 动态表单 这种表单定义方式我们可以配置表单中每一个字段的可读性、可写性、是否必填等信息&#xff0c;不过不能定义完整的表单页面。外置表单 外置表单我们只需要定义一下表单的 k…

生命周期、数据共享、ref引用、购物车案例

生命周期&数据共享 1.组件的生命周期2.组件之间的数据共享3.ref 引用4.购物车案例 1.组件的生命周期 生命周期 & 生命周期函数 生命周期&#xff08;Life Cycle&#xff09;是指一个组件从创建 -> 运行 -> 销毁的整个阶段&#xff0c;强调的是一个时间段。 生命…

chatGPT提问,BGP内容

ChatGPT提问&#xff1a;提问框架 背景角色任务要求 动态路由&#xff1a;内部网关协议&#xff1a;如RIP ISIS OSPF 在同一个公司内部运行的路由协议 外部网关协议&#xff1a;如 BGP 在不同公司之间运行的路由协议 AS&#xff1a;自治系统 每个自治系统都有唯一的…

动态组件、插槽、自定义指令、Eslint和prettierrc配置、axios全局挂载

动态组件、插槽、自定义指令、Eslint和prettierrc配置、axios全局挂载 动态组件插槽体验插槽的基础用法作用域插槽 自定义指令Eslint和prettierrc配置prettierrc axios全局挂载 动态组件 动态组件指的是动态切换组件的显示与隐藏。 如何实现动态组件渲染 vue 提供了一个内置的…

Visual Studio 2022 CMake+MinGW+GDB 调试目标程序

前段时间笔者在使用MinGW编译了QtCreator后&#xff0c;想要进行调试。最开始使用VSCode进行调试&#xff0c;可是可以调试&#xff0c;但是发现调试过程中反应比较慢&#xff0c;毕竟QtCreator整个源代码工程还是非常大的&#xff0c;VSCode是由JS语言编写&#xff0c;执行效率…

Golang每日一练(leetDay0065) 位1的个数、词频统计

目录 191. 位1的个数 Nnumber of 1-bits &#x1f31f; 192. 统计词频 Word Frequency &#x1f31f;&#x1f31f; &#x1f31f; 每日一练刷题专栏 &#x1f31f; Golang每日一练 专栏 Python每日一练 专栏 C/C每日一练 专栏 Java每日一练 专栏 191. 位1的个数 Nnum…

Java面试知识点(全)-JVM面试知识点一

[Java面试知识点(全) 导航&#xff1a; https://nanxiang.blog.csdn.net/article/details/130640392 注&#xff1a;随时更新 SQL优化 r m y s q l q u e r y ( " S E L E C T u s e r n a m e F R O M u s e r W H E R E s i g n u p d a t e > ′ r mysql_query(…

RK3568平台开发系列讲解(网络篇)图解linux ping

🚀返回专栏总目录 文章目录 一、SOCK_RAW套接字实现的ping二、ping命令发送端内核实现三、ping命令接收端内核实现沉淀、分享、成长,让自己和他人都能有所收获!😄 📢 ping 命令采用 ICMP 协议,是一个用户空间程序,它打开一个 SOCK_RAW 套接字或者ICMP套接字发送ICMP_…

Chrome启动参数常用参数

Chrome常用参数请参考下表。 序号 参数 说明 1 --allow-outdated-plugins 不停用过期的插件。 2 --allow-running-insecure-content 默认情况下&#xff0c;https 页面不允许从 http 链接引用 javascript/css/plug-ins。添加这一参数会放行这些内容。 3 …

Python爬虫入门教程,BeautifulSoup基本使用及实践

Python爬虫入门教程&#xff0c;BeautifulSoup基本使用及实践 爬虫&#xff0c;是学习Python的一个有用的分支&#xff0c;互联网时代&#xff0c;信息浩瀚如海&#xff0c;如果能够便捷的获取有用的信息&#xff0c;我们便有可能领先一步&#xff0c;而爬虫正是这样的一个工具…