![]() |
|
[Python] xpath question - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] xpath question (/showthread.php?tid=5638993) |
xpath question - Skidy - Jun 4, 2017 PHP Code I am doing PHP Code However I am getting all the numbers and everything. I just need the text "I WANT THIS" after the </br>. The way I am doing it now gives me everything. Note that there are loads of tr. I have just copied one here to make it easier to see. * - Vezel - Jun 4, 2017 (Jun 4, 2017 06:14 AM)Skidy Wrote: Check out "BeautifulSoup" for python, then you can do kinda like this Code soup = BeautifulSoup(c.get("URL"), headers=headers).content, "lxml")* - Skidy - Jun 4, 2017 (Jun 4, 2017 06:18 AM)Vezel Wrote: Check out "BeautifulSoup" for python, then you can do kinda like this Thank you I fiddled with your code as it didn't originally work but now does. Still would like it just a 1 liner. PHP Code Its a temp solution :) * - Vezel - Jun 4, 2017 (Jun 4, 2017 09:19 AM)Skidy Wrote: Thank you I fiddled with your code as it didn't originally work but now does. No problem, yeah I didn't test the code. Just wrote from the top of my head :) Glad you got it to work! |