Re: [問題] 抓取字串遇到"的問題

看板java作者 (22)時間17年前 (2008/11/09 17:31), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/3 (看更多)
※ 引述《BRN ( )》之銘言: : 不好意思 想請教一下 : 我有一串字串 : ret1=<form action="http://www.xxxx.xxxx:xx/apt_news/login.asp?act=login" 這是在html裡嗎 無論是jsp或java 字串都是" www.google.com " 長這樣的東西 : method="post" name="form1"> : 我想抓到黃色部分的字串 : 我程式碼寫成 : transurl=ret1.substring( : ret1.indexOf("=", : ret1.indexOf("action")) + 2, : ret1.indexOf("\"", : ret1.indexOf("\"", : ret1.indexOf("action"))) : ); : 他會抓不到 想請教一下 我哪裡寫錯了. : 謝謝各位 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.228.30.246

11/11 14:17, , 1F
是的 我是在抓網頁原始碼沒錯!
11/11 14:17, 1F
文章代碼(AID): #195gu0PZ (java)
文章代碼(AID): #195gu0PZ (java)