網頁

2007年5月15日 星期二

[野人獻曝]利用python抓網頁內容

程式碼如下:


import urllib2,sys,os
import hashlib

word = sys.argv[1]
content = urllib2.urlopen(word).read()

FILE = open('/home/faryne/python/'+hashlib.sha224(word).hexdigest()+'.html','w')
FILE.write(content)
FILE.close()

2007年5月13日 星期日

[野人獻曝]MySQL內mysql及information'_schema資料庫的......

雖說玩A.M.P.已經有一段時間了,

但直到最近我才發現mysql裡information_schema和mysql資料庫的內容,

真的是一堆很有趣的東西呢。



例如:

  • mysql.user:用戶權限表
  • information_schema.Column_Priviledges:欄位權限


不過話又說回來了,

如果不是工作需要,

我想我打八輩子應該都不會碰這兩個資料庫吧。



雖然現在才知道這回事,

真的是有夠不專業的!

(反正我從來都沒專業過啊~)



Technorati Tags: