By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,985 Members | 1,712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,985 IT Pros & Developers. It's quick & easy.

Data Parsing Old Website Python no error but no results when running

P: 2
I am parsing an old state website for a project and I cannot get the python code to work.

I have typed in the code I made back into the developer console and it works perfectly there but in python it just returns:

C:\Python27\python.exe "C:/Users/corinne/PycharmProjects/scc docket/SCC V1.py"
[]

Process finished with exit code 0



The code I have created is:



Expand|Select|Wrap|Line Numbers
  1. from lxml import html
  2. import requests
  3. page = requests.get('http://www.scc.virginia.gov/docketsearch#dailyFilings')
  4. tree = html.fromstring(page.text)
  5.  
  6.  
  7. dailyFilings = tree.xpath('//*[contains(@class,"details-brief")]//td[1]/text()')
  8. print dailyFilings
can anyone please help me??
Nov 5 '15 #1
Share this Question
Share on Google+
3 Replies


Expert 100+
P: 619
I get a "no module named lxml error". Are you using standard Python? Also some basic debugging should be done first. Print "page" and "tree"to see if those 2 lines are working. Generally I use urllib and BeautifulSoup (or roll my own) so don't know anything about lxml, but maybe someone else will know more.
Nov 6 '15 #2

P: 2
Thanks for responding!

I'm using JetBrains PyCharm 3.1 Community Edition.

I have never used urlib and BeautifulSoup, are you able to give me a simple example of parsing using those?
Nov 6 '15 #3

Expert 100+
P: 619
A general tutorial http://swordstyle.com/func_test_tuto...tifulsoup.html but depends on what you want from the page. Also look at http://www.pythonforbeginners.com/py...soup-4-python/
Nov 7 '15 #4

Post your reply

Sign in to post your reply or Sign up for a free account.