Armed with the extra information consider:
import bpy, bmesh
me = bpy.context.object.data
bm = bmesh.new()
bm.from_mesh(me)
EPSILON = 1.0e-5
for vert in bm.verts:
if -EPSILON <= vert.co.x <= EPSILON:
vert.select = True
bm.to_mesh(me)
bm.free()
Some clarification perhaps:
EPSILON represents a value that is close to 0. If you've ever inspected coordinates closely in Blender you will find a cut off point maybe at around 6 or 7 digits after the decimal where you start to encounter artefacts in the representation of that float. Because 0 and 0.0000012312423 are not the same number you can't simply do a check for equality with 0, instead you might check is the x component within EPSILON tolerance.
Here I make the significant digit 5 places after the decimal point, from practical experience i've found this to be sufficient.
>>> 1.0e-5 == 0.00001
True
The above will select just the vertices, from that point selecting the edges shouldn't be too difficult. Here's a quick implementation
import bpy, bmesh
me = bpy.context.object.data
bm = bmesh.new()
bm.from_mesh(me)
EPSILON = 1.0e-5
for vert in bm.verts:
if -EPSILON <= vert.co.x <= EPSILON:
vert.select = True
for edge in bm.edges:
if edge.verts[0].select and edge.verts[1].select:
edge.select = True
bm.to_mesh(me)
bm.free()
