ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Ãö©óºô­¶¸ê®Æ§ì¨ú°ÝÃD

¦^´_ 10# sujane0701

ª¦ÂΪºª¾ÃÑ­n¾a¦Û¤v¤@ÂI¤@ºwºCºC¥h¤Ñ¤ÑºN¡A¤Ñ¤Ñ²Ö¿n¡A³Ì­«­nªº¬O¡A¹J¨ì°ÝÃD­n¯à¦b"GOOGLE·j´M"§äµª®×¡A«e¤H©Ò²Ö¿nªºª¾Ãѳ£¦s¦b©óºô¸ô³o­Ó¤j¸ê®Æ®w¸Ì¡A¤p§Ì§Ú¤]¬O¯¸¦b¥¨¤HªºªÓ»H¤W¾Ç²ß¡Cµ¥±z¤j·§¬ÝÀ´HTMLªº¥D­n¼ÐÅÒ(±`¥Îªº´N¦n¡A¤£­n¹d²ÓÃû¿òªº­I)¡A¨Ã¯à°÷²z¸Ñ¦p¦ó¥ÎPython¡BChromeªº¶}µo¤H­û¤u¨ã¹ê²{POST°Ê§@«á¡A±z´N¥i¥H§ï§Úªºµ{¦¡½X¥h°µ²Ä¤G¦¸POST°Ê§@¡AÀò¨ú±z³Ì²×­nªº¸ê®Æ¤F¡A¦A°t¦Xxls®M¥ó§â¸ê®Æ¦sÀɧY¥i¡C¥H¤Uªþ¹Ï´£¥Ü²Ä¤G¦¸POSTªº°Ñ¼Æ©Ò¦b¦ì¸m¡A¦³ÃöPython¤£À´ªº»yªkGOOGLE¤@¤U§Y¥i±oª¾¡A¦³°ÝÃDÅwªï¦A´£¥X¡A¥[ªo!!!
¯u¤ß·PÁ¨C¤@¦ìÄ@·N¤À¨É©Ò¾Ç¡B«ü¾É·s¤âªº¤H!

TOP

¦^´_ 10# sujane0701

²Ä¤G¦¸POST©Ò»Ý°Ñ¼Æ¦p¹Ï¡A¥ÎChromeªº¶}µo¤H­û¤u¨ãÆ[¹î§Y¥i±oª¾POSTªº©Ò»Ý¸ê°T
¯u¤ß·PÁ¨C¤@¦ìÄ@·N¤À¨É©Ò¾Ç¡B«ü¾É·s¤âªº¤H!

TOP

¦^´_ 12# VBALearner

µo²{¤Ö®Ø¨â­Ó°Ñ¼Æ...
¨ä¹ê¥i¥H¤£¥ÎPOST¤èªk¡A¥Î­ì©l½Xµ¹ªº¤wªþ¥[°Ñ¼Æªººô§}GET¤]¥i¥H
¯u¤ß·PÁ¨C¤@¦ìÄ@·N¤À¨É©Ò¾Ç¡B«ü¾É·s¤âªº¤H!

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2017-2-9 19:59 ½s¿è

¦^´_ 11# VBALearner
½Ð±Ð¬°¦ó·|µL select ÄÝ©Ê¡H

§Ú¿é¤J¤º®e¬O§_¦³»~¡H
  1. import requests
  2. import time
  3. from bs4 import BeautifulSoup
  4. ¥D´£³æ¸¹½X=['160-69306532','608-10318674']

  5. with requests.session() as r:
  6.     res = r.get('https://accs.tradevan.com.tw/accsw-bin/APACCS/userLoginAction.do?userid=GUEST&password=GUEST')
  7.     for code in ¥D´£³æ¸¹½X:
  8.         print('¥D´£³æ¸¹½X¡G',code, '\n')
  9.         payload = {'mawb_no':code,'¬d¸ß':'¬d¸ß'}
  10.         res = r.post("https://accs.tradevan.com.tw/accsw-bin/APACCS/clmMergeQueryAction.do", data=payload)
  11.         res.encoding = "big-5"
  12.         html = BeautifulSoup(res.text,"html.parser")
  13.         for tr in html.body.select('table')[4].select('tr')[1:]:  #½Ð¸Ô¾\w3school¸Ì¦³ÃöHTMLªºTable¼ÐÅÒª¾ÃÑ¡A´N¯àª¾¹D³o¸Ì¦b°µÔ£
  14.             data = []  #«Ø¥ß°}¦C
  15.             for td in tr.select('td'):
  16.                 data.append(td.text.strip())
  17.                 if td == tr.select('td')[len(tr.select('td'))-1]: #³o¸Ì¦³¤U¤@­ÓPOST©Ò»Ýªº¸ê°T (payload)¡A³z¹LÆ[¹îºô­¶­ì©l½X±oª¾
  18.                     print('²Ä¤G¦¸POSTªº¸ê®Æ¡G',td,'\n')
  19.             print('ºK­n¸ê°T¡G',data, '\n')   #²Ä¤@¦¸¬d¸ß±o¨ìªººK­n¸ê®Æ
½Æ»s¥N½X

TOP

¦^´_ 14# c_c_lai

c¤j¡A¤£¦n·N«ä¡A³o¬O§Úªº¿ùxD
§Ú¨S¦³POµ{¦¡½X³y¦¨±zªº¤â°Ê¿é¤J¿ù»~...¯u¬O©êºp«¢«¢«¢
Å]°­Âæbºô§}ªº²Ó¸`¸Ì«¢«¢«¢

Hint : I¸òLÁÙ¯u¹³ªü¨þ¨þ
¯u¤ß·PÁ¨C¤@¦ìÄ@·N¤À¨É©Ò¾Ç¡B«ü¾É·s¤âªº¤H!

TOP

¦^´_ 15# VBALearner
¥[¤F #¡A±Æ°£ Select¡A±µ¤U¨Ó¬O¯Á¤Þ½d³ò¤F¡I

TOP

¦^´_ 16# c_c_lai

§Úµo²{¬Q¤ÑPO¹Ï®É¥´¿ù¤Fºô§}ªº¶¶§Ç¤F¡A§Ú§â§Aªº¥´¦¨§Úªº...¥¿½T¬O"¤j¼gi"¤~¹ï......= ="
ªþ­ì©l½X¡A§Æ±æ¥i¥H¤@³Ò¥Ã¶h¸Ñ¨M³o°ÝÃD ...
  1. import requests
  2. import time
  3. from bs4 import BeautifulSoup

  4. ¥D´£³æ¸¹½X = ['160-69306532','608-10318674']

  5. with requests.session() as r:
  6.     res = r.get('https://accs.tradevan.com.tw/accsw-bin/APACCS/userLoginAction.do?userid=GUEST&password=GUEST')
  7.     for code in ¥D´£³æ¸¹½X:
  8.         print('¥D´£³æ¸¹½X :',code,'\n')
  9.         payload = {'mawb_no':code,'¬d¸ß':'¬d¸ß'}
  10.         res = r.post("https://accs.tradevan.com.tw/accsw-bin/APACCS/cImMergeQueryAction.do", data=payload)
  11.         res.encoding = "big-5"
  12.         html = BeautifulSoup(res.text,"html.parser")
  13.         for tr in html.body.select('table')[4].select('tr')[1:]: #½Ð¸Ô¾\w3school¸Ì¦³ÃöHTMLªºTable¼ÐÅÒª¾ÃÑ¡A´N¯àª¾¹D³o¸Ì¦b°µÔ£
  14.             data = [] #«Ø¥ß°}¦C
  15.             for td in tr.select('td'):
  16.                 data.append(td.text.strip())
  17.                 if td == tr.select('td')[len(tr.select('td'))-1]: #³o¸Ì¦³¤U¤@­ÓPOST©Ò»Ýªº¸ê°T(payload)¡A³z¹LÆ[¹îºô­¶­ì©l½X±oª¾
  18.                     print('²Ä¤G¦¸POSTªº¸ê®Æ :',td,'\n')
  19.             print('ºK­n¸ê°T :',data,'\n') #²Ä¤@¦¸¬d¸ß±o¨ìªººK­n¸ê®Æ
½Æ»s¥N½X
¯u¤ß·PÁ¨C¤@¦ìÄ@·N¤À¨É©Ò¾Ç¡B«ü¾É·s¤âªº¤H!

TOP

¥D´£³æ¸¹½X = ['160-69306532','608-10318674']
½Ð°Ý,¦pªG·Q­n«ü¦V¬Y¤@­ÓEXCELÀɮײĤ@­Ó¤u§@ªíA2Àx¦s®æ,ÀHµÛA2ÅܤƦӨú±o¤£¦Pªº¥D¸¹¸ê®Æ,¥i¥H³o»ò°µ¶Ü?À³¸Ó¦p¦ó§ó§ï©O?

TOP

¦^´_ 18# sujane0701

Python¦³ÃöExcelªº¾Þ§@¦³«Ü¦h¤è¦¡¡Axlrd¼Ò²Õ¬O¨ä¤¤¤@ºØ
¯u¤ß·PÁ¨C¤@¦ìÄ@·N¤À¨É©Ò¾Ç¡B«ü¾É·s¤âªº¤H!

TOP

¦^´_ 17# VBALearner
¤Ó´Î¤F¡IÁÂÁ§A¡I

TOP

        ÀR«ä¦Û¦b : §g¤l¦p¤ô¡AÀH¤è´N¶ê¡AµL³B¤£¦Û¦b¡C
ªð¦^¦Cªí ¤W¤@¥DÃD