Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub PhantomTest()
- Dim driver As New WebDriver
- Dim posts As Object, post As Object
- Dim i As Long
- Set driver = New WebDriver
- driver.Start "Phantomjs", "http://www.yellowpages.com/"
- driver.get "/search?search_terms=Coffee+Shops&geo_location_terms=Los+Angeles%2C+CA"
- driver.Wait 2000
- Set posts = driver.FindElementsByClass("info")
- i = 2
- Worksheets("Sheet2").Select
- For Each post In posts
- Cells(i, 1).Value = post.FindElementByClass("business-name").Text
- Cells(i, 2).Value = post.FindElementByClass("adr").Text
- Cells(i, 3).Value = post.FindElementByClass("phones").Text
- i = i + 1
- Next post
- End Sub
- 'credits - https://codingislove.com
Add Comment
Please, Sign In to add comment