You can take lactulose or fybogel safely in pregnancy, I use fybogel and it works nicely.
To help go gently cos you don't want to strain and end up with piles, put your feet on two toilet rolls to lift your knees higher than your hips - squatting is the best and most natural position for pooing- so doing this really helps. Just take your time in the loo and relax with a book or your phone to play something, Facebook etc