Select faces inside selected edges?

How could I do this with bmesh maybe? I need to select faces inside selected edges. This works only 50% of the time and I need it to work 100%.

I’m currently selecting the weighted edges then doing this.

bpy.ops.mesh.loop_to_region(select_bigger=False)

Sometimes the selection is inverted and it has to be

bpy.ops.mesh.loop_to_region(select_bigger=True)

or it even selects random parts.

how about something like that:

bpy.ops.mesh.select_more()
bpy.ops.mesh.select_less()

Don’t think that will work either.

You get this with bpy.ops.mesh.select_more()

It deselects everything with bpy.ops.mesh.select_less()

thats odd.
It works for me.

As you have 2 more edge loops between selected loops maybe you can try that instead:

bpy.ops.mesh.select_more()
bpy.ops.mesh.select_more()
bpy.ops.mesh.select_less()
bpy.ops.mesh.select_less()

EDIT: nvm it won’t work as in your case it’s gonna select everything