根据搜索结果下载驱动之家某型号笔记本驱动程序

  • user warning: Table './zgq_smzz/blog_comments' is marked as crashed and should be repaired query: SELECT COUNT(*) FROM blog_comments c WHERE c.nid = 30 AND c.status = 0 in /home/www/zhouguoqiang/zhoume.org/modules/comment/comment.module on line 992.
  • user warning: Table './zgq_smzz/blog_comments' is marked as crashed and should be repaired query: SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.signature_format, u.picture, u.data, c.thread, c.status FROM blog_comments c INNER JOIN blog_users u ON c.uid = u.uid WHERE c.nid = 30 AND c.status = 0 ORDER BY c.thread DESC LIMIT 0, 50 in /home/www/zhouguoqiang/zhoume.org/modules/comment/comment.module on line 992.

以Sony VGN-CR31这款为例,本脚本(实为命令集,笔者注)通过分析搜索页面、下载页面,最后将结果存放于相应文件(drivers_*.txt)中,同时并下载相应文件。详细见源文件:

#!/bin/bash

mkdir drivers
cd drivers/
echo > /tmp/zgq.txt
echo -n > drivers_url.txt
echo > drivers_id.txt
echo > drivers_title.txt

for i in $(seq 1 4); do
curl http://drivers.mydrivers.com/drivers-1102-875-Sony/VGN-CR31/0-0-0-0/$i >> /tmp/zgq.txt
done

iconv -f gbk -t utf8 /tmp/zgq.txt > /tmp/zgq_1.txt

cat /tmp/zgq_1.txt | grep '<a href="/drivers/' | awk -F'</a>' '{print $1}' | grep desc > /tmp/zgq.txt

cat /tmp/zgq.txt | awk -F\/ '{print $3}' > drivers_id.txt
cat /tmp/zgq.txt | awk -F'>' '{print $3}' > drivers_title.txt

for i in `cat drivers_id.txt`; do
curl http://drivers.mydrivers.com/download/$i > /tmp/zgq.txt 2>/dev/null
cat /tmp/zgq.txt | grep dizhi | awk -F\" '{print $6}' | awk -F= '{print $3}' | head -n 1 >> drivers_url.txt
done

wget -i drivers_url.txt -N

注:本文章仅供学习研究之用,切勿用作非法用途,否则后果自负。
吃水不忘打井人,还是建议多点点人家的广告,如果有时间的话。:)

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options