python爬虫--------Beautiful Soup 案列(二十一天)

🎈🎈作者主页: 喔的嘛呀🎈🎈
🎈🎈所属专栏:python爬虫学习🎈🎈
✨✨谢谢大家捧场,祝屏幕前的小伙伴们每天都有好运相伴左右,一定要天天开心哦!✨✨ 

目录

一、股票信息提取(http://quote.stockstar.com/)

1、首先打开网页

2、我们选取信息技术行业的股票,点进去。然后先复制网页地址http://quote.stockstar.com/stock/industry_I.shtml

3、然后点点击键盘上的F12打开开发工具分析网页结构,开始定位要爬取的数据对应的网页结构

4、提取定位的网页结构元素进行分析

5、分析完了,开写

(1)使用Beautiful Soup解析HTML代码:

(2)找到包含股票信息的表格:

(3)提取表格中的行数据:

(4)遍历每一行,提取股票信息:

(6)完整代码

6、结果演示

二、提取新浪新闻热榜新闻

三、结语


一、股票信息提取(http://quote.stockstar.com/)

1、首先打开网页

2、我们选取信息技术行业的股票,点进去。然后先复制网页地址http://quote.stockstar.com/stock/industry_I.shtml

3、然后点点击键盘上的F12打开开发工具分析网页结构,开始定位要爬取的数据对应的网页结构

上图可以看出爬取的数据都在box box_02这个盒子中

4、提取定位的网页结构元素进行分析

<div class="box box02">
    <div class="bg_box" id="dataTable">
        <div class="con">
        **//这里是股票所对应的表格 需要提取**
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="trHover" id="table1">
                <thead class="tbody_right">
                <tr>
                    <td width="6%" class="align_center">
                        <a href="javascript:void(0)" sort="0" target="_self" class="newup">代码</a>
                    </td>
                    <td width="24%" class="align_center">简称
                    </td>
                    <td width="17.5%" class="align_right">
                        <a href="javascript:void(0)" sort="1" target="_self">流通市值(万元)</a>
                    </td>
                    <td width="17.5%" class="align_right">
                        <a href="javascript:void(0)" sort="2" target="_self">总市值(万元)</a>
                    </td>
                    <td width="17.5%" class="align_right">
                        <a href="javascript:void(0)" sort="3" target="_self">流通股本(万元)</a>
                    </td>
                    <td width="17.5%" class="align_right">
                        <a href="javascript:void(0)" sort="4" target="_self">总股本(万元)</a>
                    </td>

                </tr>
                </thead>
                <tbody class="tbody_right" id="datalist">
               
                //start(从start到end是要每一行对应的股票信息,我们进行遍历,最后打印出来就好了)
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000004.shtml">000004</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000004.shtml">国华网安</a></td>
                    <td class="align_right ">190063.58</td>
                    <td class="align_right ">199232.32</td>
                    <td class="align_right ">12628.81</td>
                    <td class="align_right ">13238.03</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000032.shtml">000032</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000032.shtml">深桑达A</a></td>
                    <td class="align_right ">1166377.73</td>
                    <td class="align_right ">2058568.25</td>
                    <td class="align_right ">64476.38</td>
                    <td class="align_right ">113795.92</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000158.shtml">000158</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000158.shtml">常山北明</a></td>
                    <td class="align_right ">1224653.26</td>
                    <td class="align_right ">1235730.73</td>
                    <td class="align_right ">158428.62</td>
                    <td class="align_right ">159861.67</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000409.shtml">000409</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000409.shtml">云鼎科技</a></td>
                    <td class="align_right ">364104.22</td>
                    <td class="align_right ">581661.43</td>
                    <td class="align_right ">42337.70</td>
                    <td class="align_right ">67635.05</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000503.shtml">000503</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000503.shtml">国新健康</a></td>
                    <td class="align_right ">905071.39</td>
                    <td class="align_right ">991065.37</td>
                    <td class="align_right ">89877.99</td>
                    <td class="align_right ">98417.61</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000555.shtml">000555</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000555.shtml">神州信息</a></td>
                    <td class="align_right ">1166774.74</td>
                    <td class="align_right ">1170929.32</td>
                    <td class="align_right ">97231.23</td>
                    <td class="align_right ">97577.44</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000676.shtml">000676</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000676.shtml">智度股份</a></td>
                    <td class="align_right ">914176.97</td>
                    <td class="align_right ">915255.50</td>
                    <td class="align_right ">127500.28</td>
                    <td class="align_right ">127650.70</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000682.shtml">000682</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000682.shtml">东方电子</a></td>
                    <td class="align_right ">1222620.92</td>
                    <td class="align_right ">1222743.03</td>
                    <td class="align_right ">134059.31</td>
                    <td class="align_right ">134072.70</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000839.shtml">000839</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000839.shtml">ST国安</a></td>
                    <td class="align_right ">764366.14</td>
                    <td class="align_right ">764366.14</td>
                    <td class="align_right ">391982.64</td>
                    <td class="align_right ">391982.64</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000889.shtml">000889</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000889.shtml">ST中嘉</a></td>
                    <td class="align_right ">148744.29</td>
                    <td class="align_right ">160105.78</td>
                    <td class="align_right ">86984.97</td>
                    <td class="align_right ">93629.11</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000948.shtml">000948</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000948.shtml">南天信息</a></td>
                    <td class="align_right ">528632.72</td>
                    <td class="align_right ">539879.79</td>
                    <td class="align_right ">38614.52</td>
                    <td class="align_right ">39436.07</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000971.shtml">000971</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000971.shtml">ST高升</a></td>
                    <td class="align_right ">134618.70</td>
                    <td class="align_right ">166725.83</td>
                    <td class="align_right ">84665.85</td>
                    <td class="align_right ">104859.01</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/000997.shtml">000997</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/000997.shtml">新 大 陆</a></td>
                    <td class="align_right ">1788947.49</td>
                    <td class="align_right ">1798885.70</td>
                    <td class="align_right ">102636.12</td>
                    <td class="align_right ">103206.29</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002063.shtml">002063</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002063.shtml">远光软件</a></td>
                    <td class="align_right ">943962.50</td>
                    <td class="align_right ">1024941.65</td>
                    <td class="align_right ">175457.71</td>
                    <td class="align_right ">190509.60</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002065.shtml">002065</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002065.shtml">东华软件</a></td>
                    <td class="align_right ">1625588.07</td>
                    <td class="align_right ">1795070.13</td>
                    <td class="align_right ">290283.58</td>
                    <td class="align_right ">320548.24</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002093.shtml">002093</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002093.shtml">国脉科技</a></td>
                    <td class="align_right ">713868.17</td>
                    <td class="align_right ">714317.50</td>
                    <td class="align_right ">100686.62</td>
                    <td class="align_right ">100750.00</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002095.shtml">002095</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002095.shtml">生 意 宝</a></td>
                    <td class="align_right ">392665.13</td>
                    <td class="align_right ">394243.20</td>
                    <td class="align_right ">25170.84</td>
                    <td class="align_right ">25272.00</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002123.shtml">002123</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002123.shtml">梦网科技</a></td>
                    <td class="align_right ">650474.06</td>
                    <td class="align_right ">757978.52</td>
                    <td class="align_right ">68687.86</td>
                    <td class="align_right ">80039.97</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002131.shtml">002131</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002131.shtml">利欧股份</a></td>
                    <td class="align_right ">1309578.84</td>
                    <td class="align_right ">1515714.58</td>
                    <td class="align_right ">584633.41</td>
                    <td class="align_right ">676658.29</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002148.shtml">002148</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002148.shtml">北纬科技</a></td>
                    <td class="align_right ">249222.00</td>
                    <td class="align_right ">308537.10</td>
                    <td class="align_right ">45148.91</td>
                    <td class="align_right ">55894.40</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002153.shtml">002153</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002153.shtml">石基信息</a></td>
                    <td class="align_right ">1121434.43</td>
                    <td class="align_right ">1913164.88</td>
                    <td class="align_right ">159976.38</td>
                    <td class="align_right ">272919.38</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002174.shtml">002174</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002174.shtml">游族网络</a></td>
                    <td class="align_right ">916019.16</td>
                    <td class="align_right ">917717.77</td>
                    <td class="align_right ">91419.08</td>
                    <td class="align_right ">91588.60</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002195.shtml">002195</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002195.shtml">岩山科技</a></td>
                    <td class="align_right ">1674280.22</td>
                    <td class="align_right ">1694554.91</td>
                    <td class="align_right ">565635.21</td>
                    <td class="align_right ">572484.77</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002197.shtml">002197</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002197.shtml">证通电子</a></td>
                    <td class="align_right ">491566.64</td>
                    <td class="align_right ">565213.89</td>
                    <td class="align_right ">53431.16</td>
                    <td class="align_right ">61436.29</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002212.shtml">002212</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002212.shtml">天融信</a></td>
                    <td class="align_right ">811854.37</td>
                    <td class="align_right ">823376.63</td>
                    <td class="align_right ">116813.58</td>
                    <td class="align_right ">118471.46</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002230.shtml">002230</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002230.shtml">科大讯飞</a></td>
                    <td class="align_right ">10642815.24</td>
                    <td class="align_right ">11280510.86</td>
                    <td class="align_right ">218448.59</td>
                    <td class="align_right ">231537.58</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002232.shtml">002232</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002232.shtml">启明信息</a></td>
                    <td class="align_right ">637335.59</td>
                    <td class="align_right ">637335.59</td>
                    <td class="align_right ">40854.85</td>
                    <td class="align_right ">40854.85</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002235.shtml">002235</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002235.shtml">安妮股份</a></td>
                    <td class="align_right ">319414.68</td>
                    <td class="align_right ">334413.21</td>
                    <td class="align_right ">55357.83</td>
                    <td class="align_right ">57957.23</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002238.shtml">002238</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002238.shtml">天威视讯</a></td>
                    <td class="align_right ">898866.26</td>
                    <td class="align_right ">898866.26</td>
                    <td class="align_right ">80255.92</td>
                    <td class="align_right ">80255.92</td>
                </tr>
                <tr>
                    <td class="align_center select"><a href="//stock.quote.stockstar.com/002247.shtml">002247</a></td>
                    <td class="align_center"><a href="//stock.quote.stockstar.com/002247.shtml">聚力文化</a></td>
                    <td class="align_right ">108114.83</td>
                    <td class="align_right ">142946.17</td>
                    <td class="align_right ">64354.07</td>
                    <td class="align_right ">85087.00</td>
                </tr>
                //end
                </tbody>
                <tbody>
                <tr id="has_fyStock_data" class="noSelect no_trHover">
                    <td colspan="12" class="time notSelect">
                        <span class="fl" id="latesttime_span">数据时间:2024-03-29</span>
                        <div class="fenye fr" id="divPageControl1">共<strong>422</strong>条记录<span><em>1</em></span><a
                                href="/stock/industry_I_0_0_2.html" target="_self"><em>2</em></a><a
                                href="/stock/industry_I_0_0_3.html" target="_self"><em>3</em></a><a
                                href="/stock/industry_I_0_0_4.html" target="_self"><em>4</em></a><a
                                href="/stock/industry_I_0_0_5.html" target="_self"><em>5</em></a><em>...</em><a
                                href="/stock/industry_I_0_0_15.html" target="_self"><em>15</em></a><a
                                href="/stock/industry_I_0_0_2.html" target="_self"
                                class="n"><em>下一页</em></a>到第<input type="text" class="page_input"
                                                                        id="txtPageNumber"
                                                                        onkeydown="if (event.keyCode == 13){PagedControl.GoToThePage('/stock/industry_I_0_0_{0}.html');return false;}">页<a
                                href="javascript:void(0);"
                                onclick="PagedControl.GoToThePage('/stock/industry_I_0_0_{0}.html');return false;"><em>确定</em></a>
                        </div>
                    </td>
                </tr>

                </tbody>
            </table>
        </div>
    </div>
</div>

5、分析完了,开写

(1)使用Beautiful Soup解析HTML代码:


import requests                                          
from bs4 import BeautifulSoup                            
                                                         
url = "<http://quote.stockstar.com/stock/industry_I.shtml>"
response = requests.get(url)                             
response.encoding = 'gbk'  # 设置编码为 gbk                   
soup = BeautifulSoup(response.text, 'html.parser')       
                                                         

(2)找到包含股票信息的表格:


table = soup.find('table', class_='trHover')

(3)提取表格中的行数据:

rows = table.find_all('tr')

(4)遍历每一行,提取股票信息:

pythonCopy code
for row in rows[1:]:  # Skip the header row
    cells = row.find_all('td')
    if len(cells) >= 6:  # Ensure there are enough cells
        stock_code = cells[0].text.strip()
        stock_name = cells[1].text.strip()
        circulation_market_value = cells[2].text.strip()
        total_market_value = cells[3].text.strip()
        circulation_stock = cells[4].text.strip()
        total_stock = cells[5].text.strip()

        print(f"股票代码: {stock_code}, 股票名称: {stock_name}, 流通市值: {circulation_market_value}, 总市值: {total_market_value}, 流通股本: {circulation_stock}, 总股本: {total_stock}")

(6)完整代码

import requests                                                                
from bs4 import BeautifulSoup                                                  
                                                                               
url = "<http://quote.stockstar.com/stock/industry_I.shtml>"                      
response = requests.get(url)                                                   
response.encoding = 'gbk'  # 设置编码为 gbk   不设置这个编码会乱码                                      
soup = BeautifulSoup(response.text, 'html.parser')                             
                                                                               
table = soup.find('table', class_='trHover')                                   
rows = table.find_all('tr')                                                    
                                                                               
for row in rows[1:]:  # Skip the header row                                    
    cells = row.find_all('td')                                                 
    if len(cells) >= 6:  # Ensure there are enough cells                       
        stock_code = cells[0].text.strip()                                     
        stock_name = cells[1].text.strip()                                     
        circulation_market_value = cells[2].text.strip()                       
        total_market_value = cells[3].text.strip()                             
        circulation_stock = cells[4].text.strip()                              
        total_stock = cells[5].text.strip()                                    
                                                                               
        print(f"股票代码: {stock_code}, 股票名称: {stock_name}, "                      
              f"流通市值: {circulation_market_value}, 总市值: {total_market_value}, " 
              f"流通股本: {circulation_stock}, 总股本: {total_stock}")                
                                                                                                                         

这样就可以提取出表格中的股票信息了。如果你有其他需求或者需要进一步解析页面,请提供更多详细信息。

6、结果演示

二、提取新浪新闻热榜新闻

还是给以上的步骤一样

打开网页点F12提取要爬取数据的页面结构代码,分析,写出代码。

就是提取蓝色部分的网页结构代码

<div class="blk_main_card">
			<!-- 热榜 -->
			//blk_main_li为父元素
			<div class="blk_main_li" tab-type="tab-cont">
				<ul class="uni-blk-list02 list-a list-0427" style="padding-top: 7px;">
				<li><a href="<https://sinanews.sina.cn/native_zt/yingyanlandingpage1711786917>" data="0" target="_blank">小米汽车遭遇上百余名消费者投诉</a></li>
					<li><a href="<https://sinanews.sina.cn/native_page/quanzi_914931027323416577.html>" data="1" target="_blank">偷点外卖就不要写真实姓名了</a></li>
					<li id="hot_list_ad">
				<a id="hotlist_index_3" href="<https://s.weibo.com/weibo?q=%E5%93%AA%E4%BA%9B%E4%BA%BA%E5%AE%B9%E6%98%93%E5%BE%97%E7%99%BE%E6%97%A5%E5%92%B3>" data="2" target="_blank">哪些人容易得百日咳</a>
		<ins class="sinaads sinaads-fail" id="sinaads-right-hotlist" data-ad-pdps="PDPS000000067800" data-ad-width="360" data-ad-height="26" data-ad-type="embed" style="display:none" data-ad-status="done"></ins>
		   <script>(sinaads = window.sinaads || []).push({
        params: {
            element: document.getElementById("PDPS000000067800"),
            sinaads_success_handler:function () {
                  var ads = document.getElementById("sinaads-right-hotlist");
				  var _news= document.getElementById("hotlist_index_3");
				  var hot_list_ad= document.getElementById("hot_list_ad")
				  _news.style.display="none";
			      ads.style.display= "block";
				  hot_list_ad.classList.add("hotlist_have_ad")
            },
            sinaads_fail_handler: function () {
                console.log('sinaads_fail_handler')
            }
        }
    })</script>
    
		</li>
		
		//热榜新闻都被包含在li标签中
					<li><a href="<https://sinanews.sina.cn/native_zt/yingyanlandingpage1711790585>" data="3" target="_blank">杭州东站</a></li>
					<li><a href="<https://sinanews.sina.cn/native_page/quanzi_914336910352965633.html>" data="4" target="_blank">2024中国网络媒体论坛</a></li>
					<li><a href="<https://sinanews.sina.cn/native_page/quanzi_914966334487650305.html>" data="5" target="_blank">雷军能不能生产一下相机</a></li>
					<li><a href="<https://sinanews.sina.cn/native_zt/yingyanlandingpage1711790450>" data="6" target="_blank">医院取精室里都有些什么</a></li>
					<li><a href="<https://k.sina.com.cn/article_5756451891_m1571c7c3303301b0u4.html?from=news&amp;subch=onews>" data="7" target="_blank">警方辟谣面具男用病毒针扎人</a></li>
					<li><a href="<https://finance.sina.cn/2024-03-30/detail-inaqawts0171984.d.html>" data="8" target="_blank">殡葬用品店否认南通烧纸普遍2层楼高</a></li>
					<li><a href="<https://sinanews.sina.cn/native_zt/yingyanlandingpage1711790306>" data="9" target="_blank">花间令女性群像没有郑合惠子</a></li>
					<li><a class="fe661" href="<https://sinanews.sina.cn/h5/top_news_list.d.html>" data="10" target="_blank">点击查看更多实时热点</a></li>
			
</ul>
			</div>
					</div>

分析以后写出代码

import requests
from bs4 import BeautifulSoup

# 网页 URL
url = '<https://news.sina.com.cn/>'

# 发送 GET 请求并获取响应
response = requests.get(url)

# 使用 BeautifulSoup 解析 HTML 内容
soup = BeautifulSoup(response.content, 'html.parser')

# 找到热榜新闻所在的父元素
hot_news_parent = soup.find('div', class_='blk_main_li')

# 找到所有热榜新闻条目
hot_news_list = hot_news_parent.find_all('li')

# 遍历热榜新闻列表并提取信息
for news_item in hot_news_list:
    # 提取新闻标题和链接
    news_title = news_item.a.text.strip()  # 获取新闻标题文本并去除首尾空格
    news_link = news_item.a['href']  # 获取新闻链接

    # 打印新闻标题和链接
    print(f"标题: {news_title}\\n链接: {news_link}\\n")

结果:

三、结语

通过今天的案例练习和实践,我们可以进一步加深对Beautiful Soup的理解和运用。在进行网页爬取时,记得遵守网站的爬虫规则,不要频繁请求或者过度抓取,以免对网站造成影响。同时,保持学习的态度,不断探索和尝试新的技术和方法,提高自己的爬虫能力和效率。不管做什么都一样,祝兄弟姐妹们在自己的道路上取得更多的成就!

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

同城O2O系统搭建实战:外卖跑腿APP发全攻略

在同城服务领域&#xff0c;外卖和跑腿服务成为了人们生活中不可或缺的一部分。接下来小编将带领读者进入同城O2O系统搭建的实战领域&#xff0c;详细介绍如何打造一款外卖跑腿APP。 第一步&#xff1a;需求分析 这包括对目标用户群体的调研&#xff0c;明确用户的需求和痛点。…

FreeFileSync|本地自动备份设置教程,终于可以不用手动同步了

前言 昨天小白给各位小伙伴分享了FreeFileSync软件&#xff0c;由于篇幅过长&#xff0c;所以整个教程中并没有教小伙伴们如何设置自动同步的办法。 今天小白就来唠唠&#xff1a;如何让FreeFileSync自动同步。 教程分为几种&#xff1a; 开机自动同步 开机之后自动执行一次…

OpenHarmony南向嵌入式:【XR806开发板指导文档】

一. 简介 芯片介绍 XR806是全志科技旗下子公司广州芯之联研发设计的一款支持WiFi和BLE的高集成度无线MCU芯片&#xff0c;支持OpenHarmony轻量设置系统。具有集成度高、硬件设计简单、BOM成本低、安全可靠等优点。可广泛满足 智能家居、智慧楼宇、工业互联、儿童玩具、电子竞…

【uniapp】省市区下拉列表组件

1. 效果图 2. 组件完整代码 <template><view class="custom-area-picker"><view

C语言函数指针应用——计算器(转移表)的使用

对与上一节&#xff0c;我们对指针函数已经有了深刻意识了&#xff1b;练一练吧 如果还没有学习到&#xff0c;也是没有关系的&#xff0c;可以看一看这一篇 C语言详解指针-CSDN博客https://blog.csdn.net/Asuku_/article/details/137690083希望能提高你对指针的理解 计算器的实…

在Windows下面的vscode配置cmake使用vcpkg包管理器

安装 vscode下载地址 cmake下载地址 vcpkg下载地址 创建CMake项目 // main.cpp #include <fmt/core.h>int main() {fmt::print("Hello World!\n");return 0; }// CMakeLists.txtcmake_minimum_required(VERSION 3.10)project(HelloWorld)find_package(fmt…

详解“国九条3.0版”重磅落地:A股这些方向或有新气象

围绕资本市场下一阶段的重大改革举措&#xff0c;正在从更高层面赫然开启。 4月12日&#xff0c;国务院发布《关于加强监管防范风险推动资本市场高质量发展的若干意见》&#xff08;以下简称“意见”&#xff09;&#xff0c;全文围绕新股上市发行、上市公司监管、退市机制、强…

nacos 安装保姆级教程

安装nacos nacosVersion:2.2.3 需要的java版本较高&#xff0c; 所以这里直接安装jdk17&#xff1b; 安装链接见nacos 和jdk 官网&#xff0c;具体选择下面图片中的两个版本哈 本来想直接传到csdn的&#xff0c;结果这边的资料审核还是有点繁琐&#xff0c;然后上传的速度也有点…

生产环境中秒杀接口并发量剧增与负载优化策略探讨

✨✨谢谢大家捧场&#xff0c;祝屏幕前的小伙伴们每天都有好运相伴左右&#xff0c;一定要天天开心哦&#xff01;✨✨ &#x1f388;&#x1f388;作者主页&#xff1a; 喔的嘛呀&#x1f388;&#x1f388; 目录 引言 1. 实施限流措施 1.1 令牌桶算法&#xff1a; 1.2 漏…

精品资料-2024护网HVV实战教程资料合集(共20章)

以下是资料目录&#xff0c;如需下载&#xff0c;请前往星球获取&#xff1a;https://t.zsxq.com/19vwYrf4t 精品推荐&#xff0c;2024护网HVV实战教程资料合集&#xff0c;压缩包内涵大量实战资料&#xff0c;共20章。星球内会持续更新教程包。 01-HW介绍.zip 02-HTTP&Bu…

第六季:RTSP协议详解与实时流视频预览(2)

目录 前言1 网络传输基本知识1.1 OSI七层模型1.2 TCP/IP四层模型1.3 总结 2 RTSP协议详解 前言 经过上篇文章的学习&#xff0c;我们已经了解了H.264标准的基本组成与原理&#xff0c;知道了发送的数据的格式与组成&#xff0c;即NALU。但是数据的发送要通过RTSP协议进行发送&…

Project Euler_Problem 160_Factorial Trailing Digits_费马小定理,威尔逊定理,左右互搏

原题目&#xff1a; 题目大意&#xff1a;1e12的阶乘&#xff0c;不算末尾的0&#xff0c;后5位数字为多少 解题思路&#xff1a; 暴力运算也能算&#xff0c;就是有点慢&#xff0c;优化过后可能也得算个几十分钟 这里考虑使用威尔逊定理费马小定理 用这个方法我们就可以得到…

使用Riverpod在Flutter中创建Todo列表

使用Riverpod在Flutter中创建Todo列表 视频 https://youtu.be/mlbeSD1KSIo https://www.bilibili.com/video/BV1jj42197c8/ 前言 原文 https://ducafecat.com/blog/flutter-todo-list-with-riverpod-guide-02 学习如何使用Riverpod在Flutter中构建一个功能完整的Todo列表应用…

VMware EXSI

VMware ESXI是一款行业领先、专门构建的裸机hypervisor。 它直接通过安装在物理服务器上并将其划分为多个逻辑服务器&#xff0c;也就是虚拟机。 创建过程&#xff1a;就是F11Enter 输入账号密码 添加网卡 配置网卡地址 vsphere Client工具来连接EXSI EXSI资源分割&…

4. Django 探究FBV视图

4. 探究FBV视图 视图(Views)是Django的MTV架构模式的V部分, 主要负责处理用户请求和生成相应的响应内容, 然后在页面或其他类型文档中显示. 也可以理解为视图是MVC架构里面的C部分(控制器), 主要处理功能和业务上的逻辑. 我们习惯使用视图函数处理HTTP请求, 即在视图里定义def…

c++的学习之路:23、多态(2)

摘要 多态的抽象类、原理以及虚表。 目录 摘要 一、抽象类 1、 概念 2、接口继承和实现继承 二、多态的原理 1、虚函数表 2、动态绑定与静态绑定 三、单继承和多继承关系的虚函数表 1、单继承中的虚函数表 2、多继承中的虚函数表 四、思维导图 一、抽象类 1、 概…

移动硬盘(PSSD)中文件占用空间远大于文件大小

定义 文件的大小&#xff1a;文件内容实际具有的字节数&#xff0c;它以Byte为衡量单位&#xff0c;只要文件内容和格式不发生变化&#xff0c;文件大小就不会发生变化。 文件占用空间&#xff1a;文件在磁盘上的所占空间&#xff0c;它最小的计量单位是“簇(Cluster)”。 为…

LeetCode-72. 编辑距离【字符串 动态规划】

LeetCode-72. 编辑距离【字符串 动态规划】 题目描述&#xff1a;解题思路一&#xff1a;动规五部曲解题思路二&#xff1a;动态规划【版本二】解题思路三&#xff1a;0 题目描述&#xff1a; 给你两个单词 word1 和 word2&#xff0c; 请返回将 word1 转换成 word2 所使用的最…

HarmonyOS实战开发-自定义分享

介绍 自定义分享主要是发送方将文本&#xff0c;链接&#xff0c;图片三种类型分享给三方应用,同时能够在三方应用中展示。本示例使用数据请求 实现网络资源的获取&#xff0c;使用屏幕截屏 实现屏幕的截取&#xff0c;使用文件管理 实现对文件&#xff0c;文件目录的管理&…

A Learning-Based Approach for IP Geolocation(2010年)

下载地址:Towards IP geolocation using delay and topology measurements | Proceedings of the 6th ACM SIGCOMM conference on Internet measurement 被引次数:185 Eriksson B, Barford P, Sommers J, et al. A learning-based approach for IP geolocation[C]//Passive …