得到瀏覽器的User-Agent

      近期用python作爬蟲,使用到了urllib2這個模塊。其中,爲了假裝成瀏覽器,須要在opener中添加header信息,其中的一項就是瀏覽器的User-Agent。下面的代碼用來獲得瀏覽器的User-Agent:html <html> <body> <SCRIPT> document.write( navigator.userAgent.toLowerCase() );  </SC
相關文章
相關標籤/搜索