我有一个代码从页面获取HTML内容,然后获取特定字符串的索引,然后将其拆分。
我的问题是,它没有正确分裂,而且还有不受欢迎的字符串。
代码:
URL = "https://drive.google.com/file/d/0B7--EhvK76QDRktKZm04MXVjVTQ/view";
html = Jsoup.connect(URL).get().html();
FirstDecoded = URLDecoder.decode(html, "UTF-8");
int Start = FirstDecoded.indexOf("[\"fmt_stream_map\"");
int End = FirstDecoded.indexOf("\"fmt_list\"");
String FirstSplit = FirstDecoded.substring(Start + 22, -5 + End);
String[] DummyTexts = {"<html>","<head>","</head>","<body>","</body>","</html"};
if(FirstSplit.contains(DummyTexts[0]))
FirstSplit.replace(DummyTexts[0],"");
if(FirstSplit.contains(DummyTexts[1]))
FirstSplit.replace(DummyTexts[1],"");
if(FirstSplit.contains(DummyTexts[2]))
FirstSplit.replace(DummyTexts[2],"");
if(FirstSplit.contains(DummyTexts[3]))
FirstSplit.replace(DummyTexts[3],"");
if(FirstSplit.contains(DummyTexts[4]))
FirstSplit.replace(DummyTexts[4],"");
FirstSplit.trim();
String[] Splitted = FirstSplit.split("|");
我想要的是什么:
拆分前
地址| URL | URL | URL
分裂后
[0] =网址 [1] =第二个网址
结果(我不想要的):
<!html>*a new line*<head></head>*a new line*<body>*a new line**white space*URL|URL|URL*a new line**2 White Space*</body></html>
如果我尝试拆分它,[0]为空,[1]为<!
。
HTML是:
<!doctype html>
<html>
<head>
<meta name="google" content="notranslate">
<meta http-equiv="X-UA-Compatible" content="IE=edge;">
<meta name="fragment" content="!">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<title>OnClick.mp4 - Google Drive</title>
<meta property="og:title" content="OnClick.mp4">
<meta property="og:type" content="article">
<meta property="og:site_name" content="Google Docs">
<script>(function(){(function(){function e(a){this.t={};this.tick=function(a,c,b){var d=void 0!=b?b:(new Date).getTime();this.t[a]=[d,c];if(void 0==b)try{window.console.timeStamp("CSI/" a)}catch(e){}};this.tick("start",null,a)}var a;window.performance&&(a=window.performance.timing);var f=a?new e(a.responseStart):new e;window.jstiming={Timer:e,load:f};if(a){var c=a.navigationStart,d=a.responseStart;0<c&&d>=c&&(window.jstiming.srt=d-c)}if(a){var b=window.jstiming.load;0<c&&d>=c&&(b.tick("_wtsrt",void 0,c),b.tick("wtsrt_",
"_wtsrt",d),b.tick("tbsd_","wtsrt_"))}try{a=null,window.chrome&&window.chrome.csi&&(a=Math.floor(window.chrome.csi().pageT),b&&0<c&&(b.tick("_tbnd",void 0,window.chrome.csi().startE),b.tick("tbnd_","_tbnd",c))),null==a&&window.gtbExternal&&(a=window.gtbExternal.pageT()),null==a&&window.external&&(a=window.external.pageT,b&&0<c&&(b.tick("_tbnd",void 0,window.external.startE),b.tick("tbnd_","_tbnd",c))),a&&(window.jstiming.pt=a)}catch(g){}})();})();
</script>
<script>window.gapi_onload=function(){};var scriptEl$$inline_0=document.createElement("script");scriptEl$$inline_0.src="https://apis.google.com/js/client.js";scriptEl$$inline_0.async=!0;var firstScriptEl$$inline_1=document.getElementsByTagName("script")[0];firstScriptEl$$inline_1.parentNode.insertBefore(scriptEl$$inline_0,firstScriptEl$$inline_1);
</script>
<link rel="shortcut icon" href="https://ssl.gstatic.com/docs/doclist/images/icon_14_video_favicon.ico">
<link rel="stylesheet" href="/static/file/client/css/2745349237-projector_css_rtl.css">
<script>_docs_flag_initialData={"docs-aiiws":"docs_cold_nf","docs-ails":"docs_cold","docs-fwds":"docs_nf","info_params":{},"docosEmbedApiJs":"//docs.google.com/comments/d/AAHRpnXuhyO5yfTCPldRcxO-Xq_Srdd0JamOO8LslEPvYPeUzPnTtftedmIsqUWcNeSJHWF2hg2WdKe4Zpf5PRuBTzieIUoGG1g/api/js?hl\u003dar","docosUnreadCommentsEnabled":false,"uls":"","icso":false,"docs_oogt":"NONE","docs-egc":true,"docs-chat_wabel":false,"docs-ce":true,"docs-ut":2,"docs-chat_base_url":"talkgadget.google.com/talkgadget/","docs-chat_domain_rotation":true,"docs-cwd":"","docs-epuv2":false,"promo_url":"","promo_title":"","promo_title_prefix":"","promo_content_html":"","promo_link_text":"","promo_element_id":"","promo_orientation":1,"promo_show_on_click":false,"promo_show_on_load":false,"show_promo":false,"promo_mark_dismissed_on_show":false,"promo_use_global_preference":false,"promo_close_button_text":"","docs-encp":false,"buildLabel":"texmex_2016.05-Thu_RC0","docs-show_debug_info":false,"ondlburl":"//docs.google.com","drive_url":"//drive.google.com","app_url":"https://drive.google.com/file/","docs-mid":2048,"docs-eicd":false,"docs-icdmt":[],"docs-sup":"/file","docs-uptc":["lsrp","noreplica","usp","urp","utm_source","utm_medium","utm_campaign","utm_term","utm_content","sle"],"docs-cwsd":"","docs-al":[0,0,0,1,0],"docs-ndt":"Untitled Texmex","docs-rpe":false,"docs-mdck":"","docs-mas":"","docs-etiff":false,"docs-spfe":true,"docs-mriim":1800000,"docs-eccbs":false,"docs-net-ernjp":false,"docos-sosj":false,"docs-rlmp":false,"docs-mmpt":15000,"docs-erd":false,"docs-erfar":false,"docs-ssi":false,"docs-ema":false,"docs-escd":false,"docs-ensb":false,"docs-epwf":false,"ecid":true,"docs-emo":false,"docs-eos":false,"docs-pedd":true,"docs-eir":false,"docs-dc":false,"docs-edll":false,"docs-eivu":false,"server_time_ms":1455582166639,"gaia_session_id":"","app-bc":"#d1d1d1","enable_iframed_embed_api":true,"docs-fut":"//drive.google.com#folders/{folderId}","esid":true,"esubid":false,"docs-etbs":true,"docs-isb":false,"docs-pid":"","docs-mib":5242880,"docs-mip":6250000,"enable_kennedy":true,"docs-gth":"","opendv":false,"onePickImportDocumentUrl":"","opmbs":5242880,"opmpd":2500,"opbu":"https://docs.google.com/picker","opru":"https://drive.google.com/relay.html","opdu":false,"opccp":false,"ophi":"texmex","opst":"000770F2037BC252B6F708ED31726B33CE13CDBE7A86BF0E7B","opuci":"","jobset":"prod","docs-se":false,"docs-ebcrsct":false,"docs-iror":true,"enable_client_docos":true,"enable_anchored_docos":true,"enable_docos_tickle":true,"enable_pinned_revisions":false,"enable_edit_blob_revisions":false,"upload_url":"https://docs.google.com/upload/resumableupload","enable_toolbar":true,"enable_link_opener":true,"enable_microscope":true,"enable_manage_timed_text":true,"video_embed_type":"PREFER_FLASH","enable_maps_embed":false,"maps_api_uri":"https://maps.googleapis.com/maps/api/js?key\u003dAIzaSyBCjpnguVjzi6vS67NdBtyYuvCYz3yBxCY&sensor\u003dfalse","maps_display_uri":"https://maps.google.com/maps","docs-epcc":false,"docs_abuse_link":"https://docs.google.com/abuse?id\u003d0B7--EhvK76QDRktKZm04MXVjVTQ","enable_csi":true,"csi_service_name":"texmex","third_party_default_icon_urls":{"icon16":"//ssl.gstatic.com/docs/doclist/images/generic_app_icon_16.png","icon32":"//ssl.gstatic.com/docs/doclist/images/generic_app_icon_32.png","icon64":"//ssl.gstatic.com/docs/doclist/images/generic_app_icon_64.png","icon128":"//ssl.gstatic.com/docs/doclist/images/generic_app_icon_128.png"},"enable_chrome_webstore_link":true};</script>
</head>
<body dir="rtl" role="application" onload="_onProjectorLoad();" onunload="_disposeProjector();">
<meta itemprop="name" content="OnClick.mp4">
<meta itemprop="faviconUrl" content="https://ssl.gstatic.com/docs/doclist/images/icon_14_video_favicon.ico">
<script type="text/javascript" src="/static/file/client/js/2068619951-projector_viewer__ar.js"></script>
<script>_initProjector({'id': '0B7--EhvK76QDRktKZm04MXVjVTQ', 'title': 'OnClick.mp4','isMobileWeb': true,'enableStandaloneSharing': true,'enableEmbedDialog': true,'projectorFeedbackId': '99950', 'projectorFeedbackBucket': 'viewer-web',},["",0,,1,1,1,1,,,1,0,[0,,0,"AIzaSyDVQw45DwoYh632gvsP5vPDqEKvb-Ywnb8",0,0,1,0,,,0,"/drive/v2internal",0,0,0,[0,0,0]
,0,1]
,1,5,1,,0,1,"https://docs.google.com",0,1,1,1,1,,1,20,1,0,0,1,1,[[,"0"]
,6,1,1,"ND"]
,0,0,1,,[0,,,,"https://accounts.google.com/ServiceLogin?service\u003dwise&passive\u003d1209600&continue\u003dhttps://drive.google.com/file/d/0B7--EhvK76QDRktKZm04MXVjVTQ/view&hl\u003dar&followup\u003dhttps://drive.google.com/file/d/0B7--EhvK76QDRktKZm04MXVjVTQ/view"]
,0,1,1,600000,,"https://docs.google.com",0,0,[0,1,1,1]
,["https://youtube.googleapis.com",1,2]
,1,1,,0,1,1,1,0,,,,,[1,1,1,1]
,,1,0,2,0,0,[0,"https://maps.googleapis.com/maps/api/js?key\u003dAIzaSyBCjpnguVjzi6vS67NdBtyYuvCYz3yBxCY&sensor\u003dfalse"]
,0]
,[,"OnClick.mp4","https://lh4.googleusercontent.com/pI9y-A5tCOzi0W7eYAMzgqPHfzuBbq2wno4s2mvkrgc-JNtHtHWU36w0iICXMsRjxaAFuJ0p\u003dw1600-rw",,,,"0B7--EhvK76QDRktKZm04MXVjVTQ",,,,,"video/mp4",,,0,,"https://drive.google.com/file/d/0B7--EhvK76QDRktKZm04MXVjVTQ/view",1,"https://docs.google.com/uc?id\u003d0B7--EhvK76QDRktKZm04MXVjVTQ&export\u003ddownload",[[["status","ok"]
,["hl","ar"]
,["allow_embed","0"]
,["ps","docs"]
,["partnerid","30"]
,["autoplay","0"]
,["docid","0B7--EhvK76QDRktKZm04MXVjVTQ"]
,["abd","0"]
,["public","true"]
,["el","leaf"]
,["title","OnClick.mp4"]
,["BASE_URL","https://drive.google.com/"]
,["iurl","https://docs.google.com/vt?id\u003d0B7--EhvK76QDRktKZm04MXVjVTQ"]
,["ttsurl","https://drive.google.com/timedtext?id\u003d0B7--EhvK76QDRktKZm04MXVjVTQ&vid\u003d1089c9d5a380c541"]
,["reportabuseurl","https://drive.google.com/abuse?id\u003d0B7--EhvK76QDRktKZm04MXVjVTQ"]
,["token","1"]
,["plid","V0QUM0REiMM2sQ"]
,["fmt_stream_map","37|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d37&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d3DC24BBB45AB0C09B1633ABC215282DAD3275086.1E524A3C98B38084443AF227B4676FA122CB7191&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,22|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d22&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d92CE58A6991267C1E6F28C23DC9C03F5CF7E0C7A.77E9DBA8D81F681587D68E2C9EF942DAA37D8461&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,35|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d35&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d92E5A471515BC4145F258D67C6E52F7CA0FA2530.73516C4866808CD98769225F3623A93613B65F1E&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,59|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d59&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d66DCB19D441D9742A4D21F1A08CDF488C81F728D.1864D7646337ED87C9A82951A0D524B6B3CEF451&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,34|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d34&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d1837C0B9C77AF259371C0239C7B56C68C43B86A0.68E22AF960C1C023033FD24D1138AFBE91CD02D3&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,18|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d18&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d9208D71BE0BCBE4B3DF1E7B922159C3BE921FA05.2A991F268E18F480929B6A98B107468601A55535&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,43|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d43&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d5720BE679324A8AE30BA464F81AE61CB6A551C1.69D6E187577E285BF9C2BF0415AD929EFA212D45&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18"]
,["fmt_list","37/1920x1080/9/0/115,22/1280x720/9/0/115,35/854x480/9/0/115,59/854x480/9/0/115,34/640x360/9/0/115,18/640x360/9/0/115,43/640x360/99/0/0"]
,["url_encoded_fmt_stream_map","itag\u003d37&url\u003dhttps://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl=yes&id=1089c9d5a380c541&itag=37&source=webdrive&app=texmex&ip=5.0.148.212&ipbits=8&expire=1455596566&sparams=requiressl,id,itag,source,ip,ipbits,expire&signature=3DC24BBB45AB0C09B1633ABC215282DAD3275086.1E524A3C98B38084443AF227B4676FA122CB7191&key=ck2&mm=30&mn=sn-hpa7ln7k&ms=nxu&mt=1455582034&mv=m&pl=18&type\u003dvideo/mp4; codecs="avc1.42001E, mp4a.40.2"&quality\u003dhd1080,itag\u003d22&url\u003dhttps://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl=yes&id=1089c9d5a380c541&itag=22&source=webdrive&app=texmex&ip=5.0.148.212&ipbits=8&expire=1455596566&sparams=requiressl,id,itag,source,ip,ipbits,expire&signature=92CE58A6991267C1E6F28C23DC9C03F5CF7E0C7A.77E9DBA8D81F681587D68E2C9EF942DAA37D8461&key=ck2&mm=30&mn=sn-hpa7ln7k&ms=nxu&mt=1455582034&mv=m&pl=18&type\u003dvideo/mp4; codecs="avc1.42001E, mp4a.40.2"&quality\u003dhd720,itag\u003d35&url\u003dhttps://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl=yes&id=1089c9d5a380c541&itag=35&source=webdrive&app=texmex&ip=5.0.148.212&ipbits=8&expire=1455596566&sparams=requiressl,id,itag,source,ip,ipbits,expire&signature=92E5A471515BC4145F258D67C6E52F7CA0FA2530.73516C4866808CD98769225F3623A93613B65F1E&key=ck2&mm=30&mn=sn-hpa7ln7k&ms=nxu&mt=1455582034&mv=m&pl=18&type\u003dvideo/x-flv&quality\u003dlarge,itag\u003d59&url\u003dhttps://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl=yes&id=1089c9d5a380c541&itag=59&source=webdrive&app=texmex&ip=5.0.148.212&ipbits=8&expire=1455596566&sparams=requiressl,id,itag,source,ip,ipbits,expire&signature=66DCB19D441D9742A4D21F1A08CDF488C81F728D.1864D7646337ED87C9A82951A0D524B6B3CEF451&key=ck2&mm=30&mn=sn-hpa7ln7k&ms=nxu&mt=1455582034&mv=m&pl=18&type\u003dvideo/mp4; codecs="avc1.42001E, mp4a.40.2"&quality\u003dlarge,itag\u003d34&url\u003dhttps://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl=yes&id=1089c9d5a380c541&itag=34&source=webdrive&app=texmex&ip=5.0.148.212&ipbits=8&expire=1455596566&sparams=requiressl,id,itag,source,ip,ipbits,expire&signature=1837C0B9C77AF259371C0239C7B56C68C43B86A0.68E22AF960C1C023033FD24D1138AFBE91CD02D3&key=ck2&mm=30&mn=sn-hpa7ln7k&ms=nxu&mt=1455582034&mv=m&pl=18&type\u003dvideo/x-flv&quality\u003dmedium,itag\u003d18&url\u003dhttps://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl=yes&id=1089c9d5a380c541&itag=18&source=webdrive&app=texmex&ip=5.0.148.212&ipbits=8&expire=1455596566&sparams=requiressl,id,itag,source,ip,ipbits,expire&signature=9208D71BE0BCBE4B3DF1E7B922159C3BE921FA05.2A991F268E18F480929B6A98B107468601A55535&key=ck2&mm=30&mn=sn-hpa7ln7k&ms=nxu&mt=1455582034&mv=m&pl=18&type\u003dvideo/mp4; codecs="avc1.42001E, mp4a.40.2"&quality\u003dmedium,itag\u003d43&url\u003dhttps://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl=yes&id=1089c9d5a380c541&itag=43&source=webdrive&app=texmex&ip=5.0.148.212&ipbits=8&expire=1455596566&sparams=requiressl,id,itag,source,ip,ipbits,expire&signature=5720BE679324A8AE30BA464F81AE61CB6A551C1.69D6E187577E285BF9C2BF0415AD929EFA212D45&key=ck2&mm=30&mn=sn-hpa7ln7k&ms=nxu&mt=1455582034&mv=m&pl=18&type\u003dvideo/webm&quality\u003dmedium"]
,["timestamp","1455582166637"]
,["length_seconds","19"]
]
]
,5,0,,,,,,,,,,1,"mp4"]
);</script>
</body>
</html>
答案 0 :(得分:1)
不花太多时间看你的逻辑,我可以看到你认为
FirstSplit.replace(DummyTexts[0],"");
实际上更改了String FirstSplit,但它并没有。在Java中,字符串是不可变的,因此它们无法改变。
用这样的东西替换所有这些行(显然在DummyTexts中使用不同的索引):
FirstSplit = FirstSplit.replace(DummyTexts[0], "");
请注意,这并不是更改 FirstSplit,它只是更改String FirstSplit引用的内容,将其设置为replace方法返回的新String。这可能会让你得到你想要的东西,假设剩下的东西都有效。
好的,你说你改成了这个,它仍然没有用。这可能是因为您正在创建的FirstDecoded字符串基本上是您列出的HTML中的fmt_stream_map行(减去正面和背面的几个字符):
"fmt_stream_map","37|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d37&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d3DC24BBB45AB0C09B1633ABC215282DAD3275086.1E524A3C98B38084443AF227B4676FA122CB7191&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,22|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d22&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d92CE58A6991267C1E6F28C23DC9C03F5CF7E0C7A.77E9DBA8D81F681587D68E2C9EF942DAA37D8461&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,35|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d35&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d92E5A471515BC4145F258D67C6E52F7CA0FA2530.73516C4866808CD98769225F3623A93613B65F1E&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,59|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d59&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d66DCB19D441D9742A4D21F1A08CDF488C81F728D.1864D7646337ED87C9A82951A0D524B6B3CEF451&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,34|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d34&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d1837C0B9C77AF259371C0239C7B56C68C43B86A0.68E22AF960C1C023033FD24D1138AFBE91CD02D3&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,18|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d18&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d9208D71BE0BCBE4B3DF1E7B922159C3BE921FA05.2A991F268E18F480929B6A98B107468601A55535&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18,43|https://r13---sn-hpa7ln7k.c.docs.google.com/videoplayback?requiressl\u003dyes&id\u003d1089c9d5a380c541&itag\u003d43&source\u003dwebdrive&app\u003dtexmex&ip\u003d5.0.148.212&ipbits\u003d8&expire\u003d1455596566&sparams\u003drequiressl,id,itag,source,ip,ipbits,expire&signature\u003d5720BE679324A8AE30BA464F81AE61CB6A551C1.69D6E187577E285BF9C2BF0415AD929EFA212D45&key\u003dck2&mm\u003d30&mn\u003dsn-hpa7ln7k&ms\u003dnxu&mt\u003d1455582034&mv\u003dm&pl\u003d18"] ,[
这并没有你在其中寻找的任何字符串......
好的,现在你想知道为什么拆分整个页面会给你带来疯狂的结果,而且因为split()需要一个 regex 参数,而不仅仅是一个String。一根管子&#39; |&#39;是无效的正则表达式,使用&#34; \ |&#34;相反(转义特殊字符)。 https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split(java.lang.String)