Bloggang.com : weblog for you and your gang
Sufficiency Economy
Group Blog
Japanese Language
ท่องศัพท์ภาษาญี่ปุ่นวันละคำ
NSW NDS DSi 3DS Programming
Romancing Saga2 Translation
My Japanese Coach
XNA Unity3d Programming
Miyoo Mini and Dingoo A-320
SNES NES GB programming
MAC OSX IOS APPLE
บันทึกช่วยจำ
บ้านไร่ ชายทุ่ง
Android
ไม่เข้ากลุ่ม
Graphic Art
Python Programming
Linux
English
VITA PSP Programming
Flutter WEB JAVA PHP JSP ASP
LibreOffice
ออกกำลังกาย
Gameboy Advance
All blogs
pyTorch
Youtube การใช้ Tkinter python
Python : Machine Learning [6]
Python : Machine Learning [5]
Python : Machine Learning [4]
Python : Machine Learning [3]
Python : Machine Learning [2]
Python : Machine Learning [1]
เชียนโปรแกรมได้ทุกที่ ด้วย Qpython
ทดลอง Natural Language Toolkit
python + ubuntu + japanese + write binary file ?
Python + Matplotlib
Python อ่าน และการเขียนข้อมูลลงใน binary file
ตัวอย่างการ load ไฟล์ จาก web mangareader.net
python: OpenCV สร้างภาพสีขาวดำ grayscale
python: OpenCV Crop ภาพ
Python: OpenCV ทำภาพ Smooth
python : ทดลองใช้ OpenCV
Python: การเขียนไฟล์ กับปุ่มกด
Python: โหลดการ์ตูนจาก web ตอนที่ 4
Python: โหลดการ์ตูนจาก web ตอนที่ 3
Python: โหลดการ์ตูนจาก web ตอนที่ 2
Python: โหลดการ์ตูนจาก web
Python อ่านข้อมูล text File (Lexitron)
Python อ่านโครงสร้างของ Table ของ MS Access
Python ทำโปรแกรมจัดการฐานข้อมูล MS Access อย่างง่าย
Python การจัดการ widgets ด้วย grid method
Python ติดต่อฐานข้อมูล Access
Python ทดลองเขียนโปรแกรมเครื่องคิดเลข บวก ลบ ตอนที่2
Python ทดลองเขียนโปรแกรมเครื่องคิดเลข บวก ลบ ตอนที่1
Python Step by Step ^ ^
ทดลองใช้ Python
Python: โหลดการ์ตูนจาก web
พอดีพบ web การ์ตูน onlineที่ //www.mangareader.net มีการ์ตูนเยอะดีเหมือนกัน แต่ต้องload ที่ละหน้า น่าเบื่อเหมือนกัน
ดังนั้นลอง click ขวา แล้วก็ properties ก็ได้ link url ประมาณนี้
//i35.mangareader.net/dragon-ball/1/dragon-ball-1695152.jpg
ซึ่ง python มี library load file จาก net อยู่ คือ urllib
import urllib
url = "//i14.mangareader.net/dragon-ball/1/dragon-ball-1695162.jpg"
urllib.urlretrieve(url,"test.png")
เพียงสามบรรทัดนี้ ก็ load รูปมาได้แล้ว ง่ายมากๆ
แล้วก็คิดว่า เลข ภาพจะ run ไปเรื่อยq แต่ช่าย เพราะค่า i35 จะเปลี่ยนไปเรื่อยๆแบบ random เลขก็ไม่ run ต่อ เช่นหน้าที่ 2 มี url
//i2.mangareader.net/dragon-ball/1/dragon-ball-1695153.jpg
ก็เลยหาต่อ พบว่าสิ่งที่ run เป็นลำดับก็คือไฟล์ html
หน้าที่ 1: //www.mangareader.net/105-2100-1/dragon-ball/chapter-1.html
หน้าที่ 2: //www.mangareader.net/105-2100-2/dragon-ball/chapter-1.html
หน้าที่ 3: //www.mangareader.net/105-2100-3/dragon-ball/chapter-1.html
ก็คือค่า 105-2100-1 2 3 ไปตามเลขหน้า
ต่อไปก็ดู code ใน html ว่าส่วนแสดงภาพอยู่ที่ไหน
โดย click ขวา view source ก็พบบรรทัดนี้
ไงข้างบนดันเป็นรูป link ไปส่ะได้
โดยมีคำว่า 800 เป็นจุดสังเกต โอ้สุดยอด
ดังนั้นจึงมีขั้นตอน load ภาพประมาณนี้คือ
1. load file html
2. หาบรรทัดที่มีเลข 800
3. เก็บค่าลงตัวแปร strRead
4. หา url ของ ภาพ โดยใช้คำสั่ง split กำหนดให้แยกคำด้วยเครื่องหมาย "
5. เก็บค่าในตัวแปร List
6. ดึงค่าใน List ลำดับที่ 11 มาซึ่่งก็คือ url ของรูป
7. แล้วก็ load ภาพมา save ในเครื่องก็เป็นอันเสร็จ
แล้วก็วน loop ไปเรื่อยๆ
อันนี้
source code
ลองไปไล่ ดูเองล่ะกัน
อีกหน่อย
while num<=2: ไว้กำหนดจำนวนหน้าที่ต้องการ ในที่นี้คือ สองหน้า
url = "//www.mangareader.net/105-2100-"+str(num)+"/dragon-ball/chapter-1.html"อันนี้กำหนด url หน้าแรก
Create Date : 19 กรกฎาคม 2554
Last Update : 19 กรกฎาคม 2554 19:20:27 น.
1 comments
Counter : 1245 Pageviews.
Share
Tweet
ลิงค์ source code ตาย ครับ
โดย: กฤษดา IP: 101.51.167.172 วันที่: 16 สิงหาคม 2556 เวลา:6:59:26 น.
ชื่อ :
Comment :
*ใช้ code html ตกแต่งข้อความได้เฉพาะสมาชิก
wink99_th
Location :
พิษณุโลก Thailand
[Profile ทั้งหมด]
ฝากข้อความหลังไมค์
Rss Feed
Smember
ผู้ติดตามบล็อก : 8 คน [
?
]
New Comments
Friends' blogs
Aorora
I^^
กิ่งลีลาวดี
มาทิรน
daikon
nainokkamin
jaikojung
Webmaster - BlogGang
[Add wink99_th's blog to your web]
Links
ชุมชนคนรัก ญี่ปุ่น และ ภาษาญี่ปุ่น
BlogGang.com
Pantip.com
|
PantipMarket.com
|
Pantown.com
| © 2004
BlogGang.com
allrights reserved.