Elizabeth 0 Posted December 28, 2015 Report Share Posted December 28, 2015 Hi, I'm trying to scrape addresses and put all the information in lists. I would like to extract the street, city and postal code in different columns. My problem is that when I select the address, the 3 lines are selected together. I don't know how to isolate the 1st line, then the 2nd then the 3rd since it's only separated with the tag BR. Can you help me with that problem? Thanks Elizabeth <div style="width: 50%; float: left;"> <div> <br> <div style="margin: 0 auto;"> 178 Columbus Ave<br> New York, NY<br> 10023 <br> </div> <br><br> <div> Phone: +1 212-362-1697<br> Fax: (141)824-8841<br> Web: <a href="https://www.usps.com/" target="_blank">https://www.usps.com/</a><br> Email: N/A </div> </div> Quote Link to post Share on other sites
munio 0 Posted December 28, 2015 Report Share Posted December 28, 2015 Scrape<div style="margin: 0 auto;"> * </div> wildcardthen$strip tagsthencreate table from text :-) Quote Link to post Share on other sites
pftg4 102 Posted December 29, 2015 Report Share Posted December 29, 2015 give us the url and maybe we can help Quote Link to post Share on other sites
Solution deliter 203 Posted December 29, 2015 Solution Report Share Posted December 29, 2015 I have no idea why,I think a bug in Ubot Studio with the new version,but this script takes around 30 seconds to complete This is not the correct way of solving this problemBy right you should use element child/sibling,but unfortunately for me using child/sibling is hit or miss with Ubot,eventhough I do understand the concept Can anyone write a sample of solving this with element child/sibling please???I would appreciate it This script below,simply gets the element like you are,each has 3 lines,and then sorts through them,creating a new list for each one clear list(%All rows) add list to list(%All rows,$scrape attribute(<style="margin: 0 auto;">,"innertext"),"Don\'t Delete","Global") set(#position,0,"Global") loop($list total(%All rows)) { add list to list(%list Item,$list from text($list item(%All rows,#position),$new line),"Delete","Global") add item to list(%Street,$list item(%list Item,0),"Don\'t Delete","Global") add item to list(%Area,$list item(%list Item,1),"Don\'t Delete","Global") add item to list(%Zip,$list item(%list Item,2),"Don\'t Delete","Global") clear list(%list Item) increment(#position) } 1 Quote Link to post Share on other sites
Elizabeth 0 Posted December 29, 2015 Author Report Share Posted December 29, 2015 Thanks a lot! It's working now. I have still so much to learn. Thanks again!Elizabeth 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.