bpy.ops.view3d.view_selected() issue
If you don't have a reference to a specific window, you can iterate over all screen areas, and call the operator on all VIEW_3D area types.

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        ctx = bpy.context.copy()
        ctx['area'] = area
        ctx['region'] = area.regions[-1]
        bpy.ops.view3d.view_selected(ctx)            # points view
        # bpy.ops.view3d.camera_to_view_selected(ctx)   # points camera


I think the topic and resolutions to context is incorrect have been covered exhaustively . 

If you use camera_to_view_selected(ctx) you can break the loop early if you only have one camera to point, else it will point the camera at the same thing for every 3dview opened.