cob007 19 Posted September 18, 2018 Report Share Posted September 18, 2018 I am trying to remove text as below and don't want the list item to go to new line.If however i try to remove the text "187 niches to sell online" and "drop shipping training" and add it to variable, they dont get removed. code.txt Quote Link to post Share on other sites
cob007 19 Posted September 18, 2018 Author Report Share Posted September 18, 2018 I am trying to remove text from a comma delimited list as below( I have to keep it comma delimited because i need to add it in same row in table and don't want it to go to new line. If however i try to remove the text "187 niches to sell online" and "drop shipping training" and add it to variable, they dont get removed. add list to list(%list1,$list from text("187 Niches To Sell OnlineFREE List of eCommerce Niches187 Proven Products That SELLDrop Shipping TrainingGet 10 Days of FREE TrainingFrom eCommerce Expert Anton Kraly",","),"Delete","Global")add list to list(%list,$list from text("187 Niches To Sell OnlineDrop Shipping Training",","),"Delete","Global")set(#vars,$replace($list item(%list1,0),$list item(%list,0),$nothing),"Global") Quote Link to post Share on other sites
Sanjeev 46 Posted September 18, 2018 Report Share Posted September 18, 2018 add list to list(%list1,$list from text("187 Niches To Sell OnlineFREE List of eCommerce Niches187 Proven Products That SELL Drop Shipping TrainingGet 10 Days of FREE TrainingFrom eCommerce Expert Anton Kraly ",","),"Delete","Global") You haven't comma separated your list.. like so - 187 Niches To Sell Online, FREE List of eCommerce Niches, 187 Proven Products That SELl...? Quote Link to post Share on other sites
Sanjeev 46 Posted September 18, 2018 Report Share Posted September 18, 2018 Not sure what you are after.. try this.. add list to list(%list1,$list from text("187 Niches To Sell Online,FREE List of eCommerce Niches,187 Proven Products That SELL,Drop Shipping Training,Get 10 Days of FREE TrainingFrom eCommerce Expert Anton Kraly",","),"Delete","Global")set(#replace text,$list item(%list1,0),"Global")set(#vars,$replace(%list1,$list item(%list1,0),$nothing),"Global")set(#vars,$replace regular expression(%list1,#replace text,$nothing),"Global")add list to list(%list,$list from text(#vars,""),"Delete","Global") Quote Link to post Share on other sites
Sanjeev 46 Posted September 18, 2018 Report Share Posted September 18, 2018 use Aymens file management plugin free - and you could do something like this - add list to list(%list1,$list from text("187 Niches To Sell Online,FREE List of eCommerce Niches,187 Proven Products That SELL,Drop Shipping Training,Get 10 Days of FREE TrainingFrom eCommerce Expert Anton Kraly",","),"Delete","Global")plugin command("File Management.dll", "remove all from list", %list1, $list item(%list1,0)) https://cl.ly/93414b47f633 Quote Link to post Share on other sites
cob007 19 Posted September 18, 2018 Author Report Share Posted September 18, 2018 there is no comma between 187 niches to sell online for free and description below it The text was scraped from bing ads using xpath and xbrowser expression; //h3[@class="ad_esltitle"]/.. Quote Link to post Share on other sites
cob007 19 Posted September 18, 2018 Author Report Share Posted September 18, 2018 and i want to remove those headlines(187 niches to sell online) from description without going to a new line Sorry i didn't make it clear earlier, I meant i can't use new list item or line because these data is part of one single scraped AD, so it has to stay inside one list item Quote Link to post Share on other sites
Sanjeev 46 Posted September 19, 2018 Report Share Posted September 19, 2018 add list to list(%list1,$list from text("187 Niches To Sell OnlineFREE List of eCommerce Niches187 Proven Products That SELLDrop Shipping TrainingGet 10 Days of FREE TrainingFrom eCommerce Expert Anton Kraly",","),"Delete","Global")set(#vars,$replace regular expression($list item(%list1,0),"^187 Niches To Sell Online(?=\\w+)|Drop Shipping Training(?=\\w+)",$nothing),"Global") Quote Link to post Share on other sites
cob007 19 Posted September 19, 2018 Author Report Share Posted September 19, 2018 Thanks but in this case we know what the text is, but each time it won't be possible to know that the text will be (187 Niches To Sell Online). So if it is 197 niches to sell online then what to do? Quote Link to post Share on other sites
cob007 19 Posted September 19, 2018 Author Report Share Posted September 19, 2018 Thanks but in this case we know what the text is, but each time it won't be possible to know that the text will be (187 Niches To Sell Online). So if it is 197 niches to sell online then what to do?And u can see in the screenshot now the headline and description are different. The only way i think wud be to move the description data to 2 new list items, get rid of the text using replace and move them one after another again inside a new variable? Quote Link to post Share on other sites
Sanjeev 46 Posted September 19, 2018 Report Share Posted September 19, 2018 understood.. try this while I look into this more - xpath - my bing ad search - from India - which country are you from - I have Vpn - can change to your region and try bing ads again //div[@class]/div[@class=b_caption]/p Quote Link to post Share on other sites
cob007 19 Posted September 19, 2018 Author Report Share Posted September 19, 2018 u don't need VPN, go to bing ads account(https://www.bing.com/account/), and change country to USA and do a search "dropshipping" it will show USA results using xpath and exbrowser gives the headline results as like this;using command (//h3[@class=ad_esltitle] But the description is enclosed within a div Meanwhile i will try what u gave Quote Link to post Share on other sites
cob007 19 Posted September 19, 2018 Author Report Share Posted September 19, 2018 u may have to keep refreshing bing till u see extended extensions like the one i showed you, not all advertisements have extended sitelink extensions and then if u use the xpath((//h3[@class=ad_esltitle] the headlines get scraped Quote Link to post Share on other sites
cob007 19 Posted September 19, 2018 Author Report Share Posted September 19, 2018 try doing a search like this shopify after choosing USA in bing acocunt, in case u don't see any results of extended for dropshipping, xpath(//h3[@class=ad_esltitle]) gives the headline results scraped nicely and the other code of xpath (//h3[@class=ad_esltitle]/..) (gives both headline and description clubbed together). Now I want to remove those headline texts that are clubbed with description and keep descriptions separate Quote Link to post Share on other sites
Sanjeev 46 Posted September 19, 2018 Report Share Posted September 19, 2018 this appears to work on my side - plugin command("ExBrowser.dll", "ExBrowser Launcher", "Chrome", "", "")plugin command("ExBrowser.dll", "ExBrowser Navigate", "bing.com")plugin command("ExBrowser.dll", "ExBrowser Type Text2", "//input[@class=\"b_searchbox\"]", "Yes", "dropshipping", 10, 50)plugin command("ExBrowser.dll", "ExBrowser Send Special Key", "//input[@class=\"b_searchbox\"]", "Enter", "")add list to list(%bing ads scraped,$list from text($plugin function("ExBrowser.dll", "$ExBrowser Scrape List Elements", "//li[@class=\"b_ad\"]//div[@class=\"b_caption\"]"),""),"Delete","Global") Quote Link to post Share on other sites
cob007 19 Posted September 19, 2018 Author Report Share Posted September 19, 2018 tried it but its scraping irrelevant stuff, Quote Link to post Share on other sites
cob007 19 Posted September 19, 2018 Author Report Share Posted September 19, 2018 wht im looking for was this; the text below headlines Plans Starting @ $9/monthPlans designed for beginners orexperts starting at only $9/month. Enterprise SolutionShopify Plus - Enterprise Ecommercesolution for high volume business. Quote Link to post Share on other sites
Sanjeev 46 Posted September 19, 2018 Report Share Posted September 19, 2018 wht im looking for was this; the text below headlines Plans Starting @ $9/monthPlans designed for beginners orexperts starting at only $9/month.Enterprise SolutionShopify Plus - Enterprise Ecommercesolution for high volume business. add list to list(%bing ads scraped,$list from text($plugin function("ExBrowser.dll", "$ExBrowser Scrape List Elements", "//h3[@class=\"ad_esltitle\"]/.."),""),"Delete","Global") Quote Link to post Share on other sites
Sanjeev 46 Posted September 19, 2018 Report Share Posted September 19, 2018 then this code works - add list to list(%bing ads scraped,$list from text($plugin function("ExBrowser.dll", "$ExBrowser Scrape List Elements", "//DIV[@class=\"b_vlist2col b_deep\"]"),""),"Delete","Global") ------------ Quote Link to post Share on other sites
cob007 19 Posted September 19, 2018 Author Report Share Posted September 19, 2018 yes bro that i tried also and it worked previously but now i want to seperate the headline text and description, separate them so that ppl understand that one is headline and other is description and using this gives the headline separately (xpath(//h3[@class=ad_esltitle]) But now i want the description to be seperate Quote Link to post Share on other sites
Sanjeev 46 Posted September 19, 2018 Report Share Posted September 19, 2018 what you need to do in that case - 1. get document text of the bing.com search page - using exbrowser 2. then use the generic xpath parser and some kind of loop to parse each element- [ad block] separately this way you can get your elements using xpath and also ensure they are readable. Quote Link to post Share on other sites
cob007 19 Posted September 19, 2018 Author Report Share Posted September 19, 2018 what you need to do in that case - 1. get document text of the bing.com search page - using exbrowser 2. then use the generic xpath parser and some kind of loop to parse each element- [ad block] separately this way you can get your elements using xpath and also ensure they are readable. Yes but for that i will have to load html in exbrowser right to parse them seperately later if i use parser? Without loading html in browser can I still parse data directly with document text? Quote Link to post Share on other sites
Sanjeev 46 Posted September 19, 2018 Report Share Posted September 19, 2018 set(#load html,$plugin function("ExBrowser.dll", "$ExBrowser Document Text"),"Global") use the above code - it will load html to variable Quote Link to post Share on other sites
cob007 19 Posted September 19, 2018 Author Report Share Posted September 19, 2018 ok thanks using xpath parser and element offset worked with xpath to get exact data Quote Link to post Share on other sites
cob007 19 Posted September 19, 2018 Author Report Share Posted September 19, 2018 and there was no need to load html in browser or load html in xpath browser 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.