I have:
Names John Peter
John
Peter
now what\'s the easiest way to get the Pet
Adding your edit as an answer so that it can be more easily found by others:
Use nth-of-type instead of nth-child:
nth-of-type
nth-child
soup.select("#names > p:nth-of-type(1)")