SweTech 4 Posted September 28, 2019 Report Share Posted September 28, 2019 Hi! On this forum, https://www.flashback.org/t1045448, I'm trying to scrape this part (all quotes) in all posts using Regex https://imgur.com/shWb5LJ Been trying this but doesn't seem to work.. <div class="post-bbcode-quote-wrapper">\n*.+\n*.+\n*.+\n*.(.+)\n*.+\n*.*\n*.* Any help would be appreciated Thanks Quote Link to post Share on other sites
fastlinks 16 Posted September 28, 2019 Report Share Posted September 28, 2019 //div[@class=alt2 post-bbcode-quote] Quote Link to post Share on other sites
fastlinks 16 Posted September 28, 2019 Report Share Posted September 28, 2019 or //div[@class=post-bbcode-quote-wrapper]to find xpath, use chrome extention: "truepath"to test xpath on chrome, use chrome extention: "xpath helper" 1 Quote Link to post Share on other sites
SweTech 4 Posted September 28, 2019 Author Report Share Posted September 28, 2019 Thanks but is it not doable with the help of Regex? (I don't have exbrowser so I can't use xpath) Quote Link to post Share on other sites
fastlinks 16 Posted September 28, 2019 Report Share Posted September 28, 2019 navigate("https://www.flashback.org/t1045448","Wait")set(#quote,$scrape attribute(<class="alt2 post-bbcode-quote">,"innertext"),"Global")alert(#quote) or regex from page source navigate("https://www.flashback.org/t1045448","Wait")set(#pagehtml,$document text,"Global")set(#quote,$plugin function("File Management.dll", "$Find Regex First", #pagehtml, "(?<=\\<div\\ class\\=\\\"post\\-bbcode\\-quote\\-wrapper\\\"\\>)(.|\\n)*?(?=\\<br)"),"Global")set(#quote,$strip tags(#quote),"Global")alert(#quote) Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted September 28, 2019 Report Share Posted September 28, 2019 There is also a free xpath plugin as well. https://network.ubotstudio.com/forum/index.php/topic/19449-free-xpath-plugin/ 1 Quote Link to post Share on other sites
Gogetta 263 Posted September 29, 2019 Report Share Posted September 29, 2019 Take a look at Frank's regex examplehttp://network.ubotstudio.com/forum/index.php?/topic/7162-using-regex-to-catch-text-between-sections/?/topic/7162-using-regex-to-catch-text-between-sections/ navigate("https://www.flashback.org/t1045448", "Wait") comment("Replace the line breaks before using Frank\'s regex example.") set(#DocNoLineBreaks, $replace($document text, $new line, $nothing), "Global") clear list(%quoted) add list to list(%quoted, $find regular expression(#DocNoLineBreaks, "(?<=<div class=\"post-clamped-text\">).*?(?=</div>)"), "Delete", "Global") 1 Quote Link to post Share on other sites
Gogetta 263 Posted September 30, 2019 Report Share Posted September 30, 2019 or to find xpath, use chrome extention: "truepath" to test xpath on chrome, use chrome extention: "xpath helper" Thanks! Thats a handy little plugin. I never even thought to look for a plugin to help with xpath expressions. Quote Link to post Share on other sites
fastlinks 16 Posted September 30, 2019 Report Share Posted September 30, 2019 Thanks! Thats a handy little plugin. I never even thought to look for a plugin to help with xpath expressions.Hi, a few more chrome plugin to share with you cookiebro - load and save cookies to chrome (* if you know how to upload cookie file without using open file dialog in exbrowser, please share)https://chrome.google.com/webstore/detail/cookiebro/lpmockibcakojclnfmhchibmdpmollgn?hl=en chropath - more detail xpath (right click > inspect > chropath)https://chrome.google.com/webstore/detail/chropath/ljngjbnaijcbncmcnjfhigebomdlkcjo?hl=en coordinates - find x,y on chromehttps://chrome.google.com/webstore/detail/coordinates/bpflbjmbfccblbhlcmlgkajdpoiepmkd postman inspector - it show the http request, but i dont know how to use ithttps://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo truepath (right click > relative xpath)https://chrome.google.com/webstore/detail/truepath/mgjhkhhbkkldiihlajcnlfchfcmhipmn xpath helperhttps://chrome.google.com/webstore/detail/xpath-helper/hgimnogjllphhhkhlmebbmlgjoejdpjl?hl=en xpath helper wizardhttps://chrome.google.com/webstore/detail/xpath-helper-wizard/jadhpggafkbmpdpmpgigopmodldgfcki xpath generatorhttps://chrome.google.com/webstore/detail/xpath-generator/dphfifdfpfabhbkghlmnkkdghbmocfeb to download the chrome extension file to use in exbhttps://chrome-extension-downloader.com/ Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted October 1, 2019 Report Share Posted October 1, 2019 You can just use Chrome dev. tools https://www.youtube.com/watch?v=du2Jnm-TzJc You can copy the JavaScript path in the same manner and use the run jabascript command with it. Like if you need to click a checkbox just add .click() to the js path. The video above shows how to get and verify XPath. Quote Link to post Share on other sites
SweTech 4 Posted October 1, 2019 Author Report Share Posted October 1, 2019 Thanks a lot for all your help guys - I truly appreciate it! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.